Skip to content

Commit 1db58c0

Browse files
authored
Merge pull request #16 from boutproject/resolve-path-for-version
When getting version with setuptools_scm, resolve __file__ path
2 parents f0ada15 + 9cc3cd4 commit 1db58c0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.travis.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ addons:
2626
- libxkbcommon-x11-0
2727

2828
install:
29-
- pip uninstall -y numpy
30-
- pip install boututils
31-
- pip install codecov pytest-cov
29+
- pip install setuptools_scm pytest-cov
30+
- pip install .
3231

3332
script:
3433
- pytest --cov=./
3534

3635
after_success:
37-
- codecov
36+
- codecov

boututils/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@
5757
print(error_info)
5858
raise ModuleNotFoundError(str(e) + ". " + error_info)
5959
else:
60-
__version__ = get_version(root="..", relative_to=__file__)
60+
from pathlib import Path
61+
path = Path(__file__).resolve()
62+
__version__ = get_version(root="..", relative_to=path)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'scipy',
4343
'h5py',
4444
'future',
45-
'netCDF4'
45+
'netCDF4',
4646
"importlib-metadata ; python_version<'3.8'"],
4747
extras_require={
4848
'mayavi': ['mayavi', 'PyQt5']},

0 commit comments

Comments
 (0)