Skip to content

Commit

Permalink
Merge pull request #1831 from AMICI-dev/release_0.11.32
Browse files Browse the repository at this point in the history
Release 0.11.32
  • Loading branch information
dweindl authored Jul 17, 2022
2 parents 7bc909b + 2b8158a commit fde15d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## v0.X Series

### v0.11.32 (2022-07-15)

Fixes:
* Fixed `ImportError`s during package installation with recent setuptools
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/1830

### v0.11.31 (2022-07-12)

Fixes:
Expand Down
5 changes: 4 additions & 1 deletion python/amici/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _imported_from_setup() -> bool:
"""Check whether this module is imported from `setup.py`"""

from inspect import getouterframes, currentframe
from os import sep

# in case we are imported from setup.py, this will be the AMICI package
# root directory (otherwise it is most likely the Python library directory,
Expand All @@ -75,7 +76,9 @@ def _imported_from_setup() -> bool:
# requires the AMICI extension during its installation, but seems
# unlikely...
frame_path = os.path.realpath(os.path.expanduser(frame.filename))
if frame_path == os.path.join(package_root, 'setup.py'):
if (frame_path == os.path.join(package_root, 'setup.py')
or frame_path.endswith(f"{sep}setuptools{sep}build_meta.py")
):
return True

return False
Expand Down
6 changes: 4 additions & 2 deletions python/amici/__init__.template.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""AMICI-generated module for model TPL_MODELNAME"""

import amici
from pathlib import Path

# Ensure we are binary-compatible, see #556
if 'TPL_AMICI_VERSION' != amici.__version__:
raise amici.AmiciVersionError(
'Cannot use model `TPL_MODELNAME`, generated with amici=='
f'TPL_AMICI_VERSION, together with amici=={amici.__version__} '
f'Cannot use model `TPL_MODELNAME` in {Path(__file__).parent}, '
'generated with amici==TPL_AMICI_VERSION, '
f'together with amici=={amici.__version__} '
'which is currently installed. To use this model, install '
'amici==TPL_AMICI_VERSION or re-import the model with the amici '
'version currently installed.'
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.31
0.11.32

0 comments on commit fde15d7

Please sign in to comment.