File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 python-version : ${{ matrix.python-version }}
2626 - name : Install
2727 run : ./.github/workflows/run_ci.sh
28- - name : Install CPU JAX
29- if : matrix.python-version == '3.12'
30- run : pip install -U jax
3128 - name : Test with pytest
32- env :
33- PYTEST_ADDOPTS : ${{ matrix.python-version != '3.12' && '--ignore=afqmc/test' || '' }}
3429 run : ./.github/workflows/test.sh
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ python -m pip install --upgrade pip
1212pip install " scipy<1.16"
1313pip install pytest
1414pip install .
15+ pip install -U jax
1516
1617pip install trexio
1718pip install mcfun
Original file line number Diff line number Diff line change 1+ import importlib .util
2+ import sys
3+ from pathlib import Path
4+
5+
6+ TEST_DIR = Path (__file__ ).resolve ().parent
7+ HAS_JAX = (
8+ importlib .util .find_spec ("jax" ) is not None
9+ and importlib .util .find_spec ("jaxlib" ) is not None
10+ )
11+
12+
13+ def pytest_ignore_collect (collection_path , config ):
14+ path = Path (str (collection_path ))
15+ if path .parent != TEST_DIR :
16+ return False
17+ if path .name == "conftest.py" :
18+ return False
19+ if path .suffix != ".py" or not path .name .startswith ("test_" ):
20+ return False
21+ if sys .version_info [:2 ] < (3 , 10 ):
22+ return True
23+ if path .name == "test_import.py" :
24+ return False
25+ if not HAS_JAX :
26+ return True
27+ return False
You can’t perform that action at this time.
0 commit comments