Skip to content

Commit

Permalink
error in setup.py when git command is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
squoilin committed Jan 26, 2022
1 parent d38abd8 commit d78edf4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dispaset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@
try:
from setuptools_scm import get_version
import warnings
from shutil import which
with warnings.catch_warnings():
warnings.simplefilter("ignore")
version = get_version(version_scheme='post-release',
local_scheme=lambda version: version.format_choice("" if version.exact else "+{node}", "+dirty"),
root='..', relative_to=__file__)
if which('git') is not None:
version = get_version(version_scheme='post-release',
local_scheme=lambda version: version.format_choice("" if version.exact else "+{node}", "+dirty"),
root='..', relative_to=__file__)
else:
version='N/A'
except (ImportError, LookupError):
try:
from pkg_resources import get_distribution, DistributionNotFound
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- scipy>=0.15
- matplotlib>=1.5.1
- pandas>= 0.19
- xlrd >= 0.9
- xlrd = 1.2.0
- xarray >= 0.11
- netcdf4
- pyyaml >= 5.1
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def read(*parts):
"xlrd >= 0.9",
"matplotlib >= 1.5.1",
"gdxcc >= 7",
"xlrd == 1.2.0",
"gamsxcc",
"optcc",
"setuptools_scm",
Expand Down

0 comments on commit d78edf4

Please sign in to comment.