Skip to content

Commit

Permalink
Load git config flags from pyproject.toml when verifying installation
Browse files Browse the repository at this point in the history
Make include paths absolute
Disable R & pytorch installation for python 3.7 job
Only activate test environment, not base
  • Loading branch information
langmm committed Feb 12, 2024
1 parent bf5403d commit 7e89a60
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 15 deletions.
92 changes: 82 additions & 10 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ jobs:
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-r != true
name: Set R installation based on matrix value
run: echo "INSTALLR=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-pytorch != true
name: Set Pytorch installation based on matrix value
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
Expand Down Expand Up @@ -504,8 +512,8 @@ jobs:
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: Run cmake test in command prompt (CONDA)
run: CALL "%CONDA_BAT%" activate base && CALL "%CONDA_BAT%" activate test &&
pytest --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture
tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
Expand Down Expand Up @@ -600,6 +608,8 @@ jobs:
- install-c: true
install-method: conda
install-mpi: false
install-pytorch: false
install-r: false
install-sbml: false
os-base: ubuntu
python-version: 3.7
Expand All @@ -608,6 +618,8 @@ jobs:
- install-c: true
install-method: conda
install-mpi: false
install-pytorch: true
install-r: true
install-sbml: true
os-base: ubuntu
python-version: 3.9
Expand All @@ -616,6 +628,8 @@ jobs:
- install-c: true
install-method: conda
install-mpi: false
install-pytorch: true
install-r: true
install-sbml: false
os-base: ubuntu
python-version: '3.10'
Expand All @@ -624,6 +638,8 @@ jobs:
- install-c: true
install-method: conda
install-mpi: false
install-pytorch: true
install-r: true
install-sbml: false
os-base: ubuntu
python-version: '3.11'
Expand All @@ -632,6 +648,8 @@ jobs:
- install-c: true
install-method: conda
install-mpi: false
install-pytorch: true
install-r: true
install-sbml: false
os-base: macos
python-version: 3.8
Expand All @@ -643,6 +661,10 @@ jobs:
- conda
install-mpi:
- true
install-pytorch:
- true
install-r:
- true
install-sbml:
- false
os-base:
Expand Down Expand Up @@ -696,6 +718,14 @@ jobs:
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-r != true
name: Set R installation based on matrix value
run: echo "INSTALLR=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-pytorch != true
name: Set Pytorch installation based on matrix value
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
Expand Down Expand Up @@ -875,8 +905,8 @@ jobs:
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: Run cmake test in command prompt (CONDA)
run: CALL "%CONDA_BAT%" activate base && CALL "%CONDA_BAT%" activate test &&
pytest --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture
tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
Expand Down Expand Up @@ -971,6 +1001,8 @@ jobs:
- install-c: false
install-method: pip
install-mpi: false
install-pytorch: true
install-r: false
install-sbml: false
os-base: windows
python-version: 3.8
Expand All @@ -982,6 +1014,10 @@ jobs:
- pip
install-mpi:
- true
install-pytorch:
- true
install-r:
- true
install-sbml:
- false
os-base:
Expand Down Expand Up @@ -1051,6 +1087,14 @@ jobs:
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-r != true
name: Set R installation based on matrix value
run: echo "INSTALLR=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-pytorch != true
name: Set Pytorch installation based on matrix value
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
Expand Down Expand Up @@ -1230,8 +1274,8 @@ jobs:
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: Run cmake test in command prompt (CONDA)
run: CALL "%CONDA_BAT%" activate base && CALL "%CONDA_BAT%" activate test &&
pytest --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture
tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
Expand Down Expand Up @@ -1328,6 +1372,10 @@ jobs:
- conda
install-mpi:
- false
install-pytorch:
- true
install-r:
- true
install-sbml:
- false
os-base:
Expand Down Expand Up @@ -1389,6 +1437,14 @@ jobs:
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-r != true
name: Set R installation based on matrix value
run: echo "INSTALLR=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-pytorch != true
name: Set Pytorch installation based on matrix value
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
Expand Down Expand Up @@ -1568,8 +1624,8 @@ jobs:
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: Run cmake test in command prompt (CONDA)
run: CALL "%CONDA_BAT%" activate base && CALL "%CONDA_BAT%" activate test &&
pytest --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture
tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
Expand Down Expand Up @@ -1666,6 +1722,10 @@ jobs:
- pip
install-mpi:
- false
install-pytorch:
- true
install-r:
- true
install-sbml:
- false
os-base:
Expand Down Expand Up @@ -1726,6 +1786,14 @@ jobs:
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-r != true
name: Set R installation based on matrix value
run: echo "INSTALLR=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-pytorch != true
name: Set Pytorch installation based on matrix value
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
Expand Down Expand Up @@ -1905,8 +1973,8 @@ jobs:
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: Run cmake test in command prompt (CONDA)
run: CALL "%CONDA_BAT%" activate base && CALL "%CONDA_BAT%" activate test &&
pytest --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture
tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
Expand Down Expand Up @@ -2003,6 +2071,10 @@ jobs:
- pip
install-mpi:
- false
install-pytorch:
- true
install-r:
- true
install-sbml:
- false
os-base:
Expand Down
16 changes: 13 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,19 @@ def setup_ci(opts, disable_extra=False):
if not os.path.isfile('pyproject.toml'):
raise RuntimeError("The CI tests must be run from the root "
"directory of the yggdrasil git repository.")
src_cmd = ('python -c \"import setuptools_scm; '
'print(setuptools_scm.get_version('
'git_describe_command = \\\"git describe --tags --long\\\"))\"')
try:
import tomllib
with open('pyproject.toml', "rb") as f:
pyproject_data = tomllib.load(f)
except ImportError:
import toml as toml
with open('pyproject.toml', "r") as f:
pyproject_data = toml.load(f)
git_version = pyproject_data['tool']['setuptools_scm']['git_describe_command']
src_cmd = (
f'python -c \"import setuptools_scm; '
f'print(setuptools_scm.get_version('
f'git_describe_command = \\\"{git_version}\\\"))\"')
dst_cmd = ('python -c \"import yggdrasil; '
'print(yggdrasil.__version__)\"')
dir_cmd = ('python -c \"import yggdrasil; '
Expand Down
Loading

0 comments on commit 7e89a60

Please sign in to comment.