Skip to content

Commit 5a58e11

Browse files
committed
ci cleanup
1 parent 39b2351 commit 5a58e11

3 files changed

Lines changed: 28 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,5 @@ jobs:
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

‎.github/workflows/run_ci.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ python -m pip install --upgrade pip
1212
pip install "scipy<1.16"
1313
pip install pytest
1414
pip install .
15+
pip install -U jax
1516

1617
pip install trexio
1718
pip install mcfun

‎pyscf/afqmc/test/conftest.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

0 commit comments

Comments
 (0)