battleschool
battleschool copied to clipboard
Drop `DIST_MODULE_PATH`
People may install python into a non-standard location other than /usr
, such as $HOME
. That means DIST_MODULE_PATH
should be always based on sys.prefix
.
Now DIST_MODULE_PATH
has been removed. Data files location will not be related with sys.prefix
.
You'll have to walk me through all of your changes. I don't understand them. Also, please rebase.
This patch installs data files (the share
directory) into the same location of *.py
files. No files will be installed into /usr/local/share/battleschool
or os.path.join(sys.prefix, 'share/battleschool')
any more.
The effect is: we can access library/mac_pkg
or defaults/hosts
via pkg_resources
API, rather than DIST_MODULE_PATH
. So, we can remove DIST_MODULE_PATH
completely.
This patch has been rebased to master. Should I rebase it back to the original commit (49d8c12) ?
Installs on my mac to /Library/Python/2.7/site-packages/battleschool
which according to the About System Integrity Protection page is ok.
The following works for me:
def get_share_path(*paths):
lib_path = os.path.dirname(__file__)
share_path = os.path.join(lib_path, 'share')
return os.path.join(share_path, *paths)
@dochang any objections?
Dropped pkg_resources
and setuptools
. @spencergibb