Skip to content

Commit

Permalink
Add looseversion dependance for py3.12
Browse files Browse the repository at this point in the history
fixes #387
  • Loading branch information
benjaminrose committed Jan 30, 2024
1 parent 5b58453 commit 64f70e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ zip_safe = False
install_requires =
astropy>=3.1
extinction>=0.4.4
looseversion>=1.0.0
numpy>=1.14.5 # 1.14.6 seems to work but not with oldest-supported-numpy
pyyaml>=3.13
scipy>=1.3.0
Expand All @@ -36,6 +37,7 @@ python_requires = >=3.7
oldestdeps = # Oldest versions supported, used for tests.
astropy==3.1
extinction==0.4.4
looseversion==1.0.0
numpy==1.14.5
pyyaml==3.13
scipy==1.3.0
Expand Down
6 changes: 5 additions & 1 deletion sncosmo/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ def _run_iminuit(chisq, parameter_names, start_values, start_errors, bounds,

# The iminuit API changed significantly in version 2. Handle both the new
# and old APIs.
from distutils.version import LooseVersion
try:
from distutils.version import LooseVersion
except ModuleNotFoundError:
# distutils was dropped in python 2.12
from looseversion import LooseVersion
iminuit_version = LooseVersion(iminuit.__version__)

if verbose:
Expand Down

0 comments on commit 64f70e4

Please sign in to comment.