Skip to content

Commit

Permalink
Merge pull request #16 from boutproject/resolve-path-for-version
Browse files Browse the repository at this point in the history
When getting version with setuptools_scm, resolve __file__ path
  • Loading branch information
ZedThree authored Jan 4, 2021
2 parents f0ada15 + 9cc3cd4 commit 1db58c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ addons:
- libxkbcommon-x11-0

install:
- pip uninstall -y numpy
- pip install boututils
- pip install codecov pytest-cov
- pip install setuptools_scm pytest-cov
- pip install .

script:
- pytest --cov=./

after_success:
- codecov
- codecov
4 changes: 3 additions & 1 deletion boututils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@
print(error_info)
raise ModuleNotFoundError(str(e) + ". " + error_info)
else:
__version__ = get_version(root="..", relative_to=__file__)
from pathlib import Path
path = Path(__file__).resolve()
__version__ = get_version(root="..", relative_to=path)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'scipy',
'h5py',
'future',
'netCDF4'
'netCDF4',
"importlib-metadata ; python_version<'3.8'"],
extras_require={
'mayavi': ['mayavi', 'PyQt5']},
Expand Down

0 comments on commit 1db58c0

Please sign in to comment.