Skip to content

Commit

Permalink
Some updates to the tox config (#429)
Browse files Browse the repository at this point in the history
Co-authored-by: Zach Burnett <[email protected]>
Co-authored-by: Brett Graham <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 3fd2b3d commit ff946ba
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 36 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,35 @@ jobs:
- linux: py310
- linux: py311-cov
coverage: codecov
- linux: py312
- linux: py312-withromancal-cov
coverage: codecov
- linux: py313
- macos: py311
test_upstream:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
with:
envs: |
- linux: rad
test_with_romancal:
environment:
runs-on: ubuntu-latest
steps:
- id: data_path
run: echo "path=${{ runner.temp }}/data" >> $GITHUB_OUTPUT
outputs:
data_path: ${{ steps.data_path.outputs.path }}
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
romancal:
needs: [ environment, crds_contexts ]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
with:
setenv: |
CRDS_PATH: ${{ needs.environment.outputs.data_path }}/crds
CRDS_SERVER_URL: https://roman-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: ${{ needs.environment.outputs.data_path }}/crds
cache-key: crds-${{ needs.crds_contexts.outputs.roman }}
envs: |
- linux: withromancal
coverage: codecov
- linux: romancal
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"asdf >=3.3.0",
"asdf-astropy >=0.5.0",
"gwcs >=0.19.0",
"numpy >=1.22",
"numpy >=1.24",
"astropy >=5.3.0",
"rad >=0.22.0, <0.23.0",
# "rad @ git+https://github.com/spacetelescope/rad.git",
Expand All @@ -29,7 +29,7 @@ file = "LICENSE"
test = [
"pytest >=6.0.0",
"pytest-doctestplus",
"pytest-doctestplus >=0.10.0",
"pytest-doctestplus >=1.2.1",
"pytest-env >= 0.8",
]
aws = ["stsci-aws-utils >= 0.1.2"]
Expand Down Expand Up @@ -63,7 +63,10 @@ minversion = 4.6
doctest_plus = true
doctest_rst = true
text_file_format = "rst"
addopts = "--color=yes --doctest-rst"
addopts = [
"--color=yes",
"--doctest-rst",
]
testpaths = ["tests"]
filterwarnings = [
"error",
Expand Down
6 changes: 2 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ git+https://github.com/asdf-format/asdf-wcs-schemas
git+https://github.com/astropy/asdf-astropy

# Use weekly astropy dev build
--extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre
--extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa --pre
astropy>=0.0.dev0
pyerfa>=0.0.dev0

# Use Bi-weekly numpy/scipy dev builds
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
numpy>=0.0.dev0
scipy>=0.0.dev0

Expand Down
52 changes: 27 additions & 25 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[tox]
env_list =
check-{style,build}
test{,-devdeps}{,-pyargs,-cov}-xdist
test{,-devdeps}{,-pyargs,-cov}-xdist-withromancal
test-numpy{120,121,122}-xdist
build-{docs,dist}
withromancal
romancal
requires =
tox-uv

# tox environments are constructed with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
Expand All @@ -14,6 +16,8 @@ env_list =
#
# tox -l -v
#
[main]
rcal_repo = https://github.com/spacetelescope/romancal.git

[testenv:check-style]
skip_install = true
Expand All @@ -32,27 +36,41 @@ description =
warnings: treating warnings as errors
cov: with coverage
xdist: using parallel processing
allowlist_externals =
git
pass_env =
CRDS_*
HOME
CI
TOXENV
CODECOV_*
set_env =
devdeps: UV_INDEX = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
devdeps: UV_INDEX_STRATEGY = unsafe-any-match
extras =
test
uv_resolution =
oldestdeps: lowest-direct
deps =
withromancal: romancal @ git+{[main]rcal_repo}
xdist: pytest-xdist
cov: pytest-cov
oldestdeps: minimum_dependencies
cov: pytest-cov >= 4.1.0
rad: rad @ git+https://github.com/spacetelescope/rad.git@main#egg=rad
romancal: setuptools # for pkg_resources for pysiaf
romancal: romancal[test] @ git+{[main]rcal_repo}
devdeps: -r requirements-dev.txt
oldestdeps: minimum_dependencies
change_dir =
romancal: {env_tmp_dir}
commands_pre =
oldestdeps: minimum_dependencies roman_datamodels --filename requirements-min.txt
oldestdeps: pip install -r requirements-min.txt
devdeps: pip install -r requirements-dev.txt -U --upgrade-strategy eager
pip freeze
oldestdeps: minimum_dependencies roman_datamodels --filename {env_tmp_dir}/requirements-min.txt
oldestdeps: uv pip install -r {env_tmp_dir}/requirements-min.txt
{list_dependencies_command}
romancal: git clone -n --depth=1 --filter=blob:none {[main]rcal_repo}
romancal: git --git-dir={envtmpdir}/romancal/.git checkout HEAD pyproject.toml
commands =
pytest \
warnings: -W error \
romancal: --config-file={env_tmp_dir}/pyproject.toml --pyargs romancal \
xdist: -n auto \
cov: --cov=roman_datamodels --cov=tests --cov-config pyproject.toml --cov-report term-missing --cov-report xml \
{posargs}
Expand All @@ -70,19 +88,3 @@ deps =
build
commands =
python -m build .

[testenv:withromancal]
allowlist_externals =
git
bash
deps =
pytest-cov
commands_pre =
bash -c "pip freeze -q | grep 'roman_datamodels @' > {env_tmp_dir}/requirements.txt"
pip install git+https://github.com/spacetelescope/romancal.git
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest tests/test_open.py::test_open_asn \
--cov=tests --cov-config pyproject.toml --cov-report term-missing --cov-report xml \
{posargs}

0 comments on commit ff946ba

Please sign in to comment.