Skip to content

Commit

Permalink
RTD: simplify amici installation (#1940)
Browse files Browse the repository at this point in the history
after #1939, we can simply install it via rtd_requirements.txt
  • Loading branch information
dweindl authored Jan 24, 2023
1 parent c25c666 commit 2b79ec7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
21 changes: 1 addition & 20 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,26 +126,7 @@ def install_doxygen():

# Install AMICI if not already present
typing.TYPE_CHECKING = True

try:
import amici
except ModuleNotFoundError:
subprocess.run([
'python', '-m', 'pip', 'install', '--verbose', '-e',
os.path.join(amici_dir, 'python', 'sdist')
], check=True)

from importlib import invalidate_caches

invalidate_caches()

sys.path.insert(0, amici_dir)
sys.path.insert(0, os.path.join(amici_dir, 'python', 'sdist'))

import amici
# Works around some cyclic dependency issue with amici.petab_import_pysb
import amici.petab_import

import amici
typing.TYPE_CHECKING = False


Expand Down
2 changes: 2 additions & 0 deletions documentation/rtd_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# NOTE: relative paths are expected to be relative to the repository root
sphinx==5.1.1
mock>=4.0.3
setuptools==65.5.1
Expand All @@ -20,3 +21,4 @@ sphinxcontrib-napoleon>=0.7
pygments==2.13.0
Jinja2==3.1.2
git+https://github.com/readthedocs/readthedocs-sphinx-ext
-e python/sdist/
4 changes: 2 additions & 2 deletions scripts/run-sphinx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ AMICI_PATH=$(cd $SCRIPT_PATH/.. && pwd)
python3 -m venv ${AMICI_PATH}/doc-venv --clear
source ${AMICI_PATH}/doc-venv/bin/activate
python -m pip install --upgrade --no-cache-dir pip
python -m pip install --exists-action=w --no-cache-dir -r ${AMICI_PATH}/documentation/rtd_requirements.txt
python -m pip install --exists-action=w --no-cache-dir -r ${AMICI_PATH}/documentation/rtd_requirements2.txt
(cd ${AMICI_PATH}/ && python -m pip install --exists-action=w --no-cache-dir -r documentation/rtd_requirements.txt)
(cd ${AMICI_PATH}/ && python -m pip install --exists-action=w --no-cache-dir -r documentation/rtd_requirements2.txt)

${AMICI_PATH}/scripts/run-sphinx-hasenv.sh

Expand Down

0 comments on commit 2b79ec7

Please sign in to comment.