Skip to content

Commit

Permalink
attempt to isolate jwst/romancal pytest configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Oct 2, 2024
1 parent 787aa81 commit 97f5a2d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ jobs:
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
envs: |
- linux: py311-jwst-cov-xdist
- linux: py311-romancal-cov-xdist
- linux: jwst-cov
- linux: romancal-cov
coverage: codecov
64 changes: 54 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ envlist =
test-numpy{120,121,122}
test-{jwst,romancal}-xdist
build-{docs,dist}
jwst{,-cov}
romancal{,-cov}

# tox environments are constructed with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
Expand Down Expand Up @@ -53,10 +55,10 @@ description =
xdist: using parallel processing
extras =
test
allowlist_external =
git
deps =
xdist: pytest-xdist
jwst: jwst[test] @ git+https://github.com/spacetelescope/jwst.git
romancal: romancal[test] @ git+https://github.com/spacetelescope/romancal.git
oldestdeps: minimum_dependencies
devdeps: numpy>=0.0.dev0
devdeps: scipy>=0.0.dev0
Expand All @@ -71,14 +73,8 @@ deps =
use_develop = true
pass_env =
CI
WEBBPSF_PATH
set_env =
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
jwst: CRDS_SERVER_URL=https://jwst-crds.stsci.edu
romancal: CRDS_SERVER_URL=https://roman-crds.stsci.edu
jwst,romancal: CRDS_PATH={package_root}/crds_cache
jwst,romancal: CRDS_CLIENT_RETRY_COUNT=3
jwst,romancal: CRDS_CLIENT_RETRY_DELAY_SECONDS=20
commands_pre =
oldestdeps: minimum_dependencies stcal --filename requirements-min.txt
oldestdeps: pip install -r requirements-min.txt
Expand All @@ -87,8 +83,6 @@ commands =
pytest \
warnings: -W error \
xdist: -n auto \
jwst: --pyargs jwst --ignore-glob=timeconversion --ignore-glob=associations --ignore-glob=*/scripts/* \
romancal: --pyargs romancal \
cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing --cov-report=xml \
{posargs}

Expand All @@ -106,3 +100,53 @@ deps =
build
commands =
python -m build .

[testenv:jwst]
deps=
pytest-xdist
change_dir = {env_tmp_dir}
allowlist_externals =
git
bash
extras =
set_env =
CRDS_SERVER_URL = https://jwst-crds.stsci.edu
CRDS_PATH = {package_root}crds_cache
CRDS_CLIENT_RETRY_COUNT = 3
CRDS_CLIENT_RETRY_DELAY_SECONDS = 20
commands_pre =
bash -c "pip freeze -q | grep 'stcal @' > {env_tmp_dir}/requirements.txt"
git clone https://github.com/spacetelescope/jwst.git
pip install -e jwst[test]
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest --numprocesses auto jwst \
cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing \
{posargs}

[testenv:romancal]
deps=
pytest-xdist
change_dir = {env_tmp_dir}
allowlist_externals =
git
bash
extras =
pass_env =
WEBBPSF_PATH
set_env =
CRDS_SERVER_URL = https://roman-crds.stsci.edu
CRDS_PATH = {package_root}crds_cache
CRDS_CLIENT_RETRY_COUNT = 3
CRDS_CLIENT_RETRY_DELAY_SECONDS = 20
commands_pre =
bash -c "pip freeze -q | grep 'stcal @' > {env_tmp_dir}/requirements.txt"
git clone https://github.com/spacetelescope/romancal.git
pip install -e romancal[test]
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest --numprocesses auto jwst \
cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing \
{posargs}

0 comments on commit 97f5a2d

Please sign in to comment.