Skip to content

Commit

Permalink
Fix data_files location when installing with wheel
Browse files Browse the repository at this point in the history
Added logic to correctly locate data_files within the package
when installed using wheel. (Fixes #142)
  • Loading branch information
hernan-erasmo authored and arne-cl committed May 6, 2016
1 parent 076f987 commit 37f57d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/discoursegraphs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def get_package_root_dir(src_root_dir=SRC_ROOT_DIR):
if dirname.startswith('discoursegraphs') and dirname.endswith('.egg'):
# package was installed via setup.py
return parentdir_path
elif dirname == 'site-packages':
# package was installed using wheel
base_dir_path = os.path.join(os.sep, *parentdir_path.split(os.sep)[:-5])
return base_dir_path
else: # software was installed via requirements.txt
grandparentdir_path = os.path.abspath(
os.path.join(SRC_ROOT_DIR, os.pardir, os.pardir))
Expand Down

0 comments on commit 37f57d4

Please sign in to comment.