Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tox envs #533

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
with:
envs: |
- linux: py310
- linux: py310-numpy125
- linux: py311
pytest-results-summary: true
- macos: py311
pytest-results-summary: true
- linux: py311-pyargs
- linux: py310-oldestdeps
- linux: py311-cov
coverage: codecov
pytest-results-summary: true
- macos: py311
pytest-results-summary: true
- linux: py312
- linux: py3-dev
26 changes: 15 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ authors = [
{ name = "gwcs developers", email = "[email protected]" },
]
dependencies = [
"asdf >= 2.8.1",
"astropy >= 5.3",
"numpy",
"scipy",
"asdf >= 3.3.0",
"astropy >= 6.0",
"numpy>=1.24",
"scipy>=1.14.1",
"asdf_wcs_schemas >= 0.4.0",
"asdf-astropy >= 0.2.0",
"asdf-astropy >= 0.5.0",
]
dynamic = [
"version",
Expand Down Expand Up @@ -46,15 +46,14 @@ docs = [
]
test = [
"ci-watson>=0.3.0",
"pytest>=4.6.0",
"pytest-astropy",
"pytest>=7.0.0",
"pytest-astropy>=0.11.0",
]

[build-system]
requires = [
"setuptools>=61.2",
"setuptools_scm[toml]>=3.4",
"wheel",
]
build-backend = "setuptools.build_meta"

Expand All @@ -76,14 +75,19 @@ upload-dir = "docs/_build/html"
show-response = 1

[tool.pytest.ini_options]
minversion = "4.6"
minversion = 4.6
doctest_plus = true
doctest_rst = true
text_file_format = "rst"
addopts = [
"--color=yes",
"--doctest-rst",
]
norecursedirs = [
"build",
"docs/_build",
".tox",
]
doctest_plus = "enabled"
addopts = "--doctest-rst"
filterwarnings = [
"ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning",
"ignore:numpy.ndarray size changed:RuntimeWarning",
Expand Down
8 changes: 3 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
git+https://github.com/asdf-format/asdf
git+https://github.com/asdf-format/asdf-standard

# Use weekly astropy dev build
--extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre

git+https://github.com/astropy/asdf-astropy
git+https://github.com/asdf-format/asdf-transform-schemas
git+https://github.com/asdf-format/asdf-coordinates-schemas
git+https://github.com/asdf-format/asdf-wcs-schemas

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

numpy>=0.0.dev0
scipy>=0.0.dev0
140 changes: 51 additions & 89 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tox]
envlist =
check-{style,security,build}
test{,-dev}{,-pyargs,-cov}
test-numpy{123,125}
build-{docs,dist}
check-{style,security}
test{,-dev}{,-oldestdeps,-cov}{-jwst,-romancal,-romanisim,-specutils,-dkist,-ndcube}
docs
requres =
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 @@ -13,6 +14,13 @@ envlist =
#
# tox -l -v
#
[main]
jwst_repo = https://github.com/spacetelescope/jwst.git
romancal_repo = https://github.com/spacetelescope/romancal.git
romanisim_repo = https://github.com/spacetelescope/romanisim.git
specutils_repo = https://github.com/astropy/specutils.git
dkist_repo = https://github.com/DKISTDC/dkist.git
ndcube_repo = https://github.com/sunpy/ndcube.git

[testenv:check-style]
description = check code style, e.g. with flake8
Expand All @@ -30,27 +38,27 @@ deps =
commands =
bandit -r -ll -c .bandit.yaml gwcs

[testenv:check-build]
description = check build sdist/wheel and a strict twine check for metadata
skip_install = true
deps =
twine>=3.3
build
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
extras = docs
commands =
python -m build .
twine check --strict dist/*
sphinx-build -W docs docs/_build

[testenv]
description =
run tests
jwst: of JWST pipeline
romancal: of Romancal pipeline
romanisim: of Romanisim image simulation
specutils: of Specutils
dkist: of DKIST
ndcube: of NDCube
dev: with the latest developer version of key dependencies
pyargs: with --pyargs on installed package
warnings: treating warnings as errors
oldestdeps: with the oldest supported version of key dependencies
cov: with coverage
xdist: using parallel processing
allowlist_externals =
jwst,romancal,romanisim,specutils,dkist,ndcube: git
pass_env =
HOME
GITHUB_*
Expand All @@ -64,90 +72,44 @@ pass_env =
romanisim: FFTW_DIR
romanisim: LIBRARY_PATH
set_env =
dev: 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

args_are_paths = false
change_dir = pyargs: {env:HOME}
dev: UV_INDEX = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
dev: UV_INDEX_STRATEGY = unsafe-any-match
change_dir =
jwst,romancal,romanisim,specutils,dkist,ndcube: {env_tmp_dir}
extras =
test
alldeps: all
uv_resolution =
oldestdeps: lowest-direct
deps =
xdist: pytest-xdist
cov: pytest-cov
jwst: jwst[test] @ git+https://github.com/spacetelescope/jwst.git
romancal: romancal[test] @ git+https://github.com/spacetelescope/romancal.git
romanisim: romanisim[test] @ git+https://github.com/spacetelescope/romanisim.git
numpy123: numpy==1.23.*
numpy125: numpy==1.25.*
jwst: jwst[test] @ git+{[main]jwst_repo}
romancal: romancal[test] @ git+{[main]romancal_repo}
romanisim: romanisim[test] @ git+{[main]romanisim_repo}
specutils: specutils[test] @ git+{[main]specutils_repo}
dkist: dkist[tests] @ git+{[main]dkist_repo}
ndcube: ndcube[dev] @ git+{[main]ndcube_repo}
dev: -r requirements-dev.txt
commands_pre =
dev: pip install -r requirements-dev.txt -U --upgrade-strategy eager
pip freeze
{list_dependencies_command}
jwst: git clone -n --depth=1 --filter=blob:none {[main]jwst_repo} target_repo
romancal: git clone -n --depth=1 --filter=blob:none {[main]romancal_repo} target_repo
romanisim: git clone -n --depth=1 --filter=blob:none {[main]romanisim_repo} target_repo
specutils: git clone -n --depth=1 --filter=blob:none {[main]specutils_repo} target_repo
dkist: git clone -n --depth=1 --filter=blob:none {[main]dkist_repo} target_repo
ndcube: git clone -n --depth=1 --filter=blob:none {[main]ndcube_repo} target_repo

jwst,romancal,romanisim,specutils,dkist,ndcube: git --git-dir={env_tmp_dir}/target_repo/.git checkout HEAD pyproject.toml
commands =
pytest \
warnings: -W error \
jwst,romancal,romanisim,specutils,dkist,ndcube: --config-file={env_tmp_dir}/pyproject.toml --pyargs \
jwst: jwst --ignore-glob=timeconversion --ignore-glob=associations --ignore-glob=scripts --show-capture=no \
romancal: romancal \
romanisim: romanisim \
specutils: specutils \
dkist: dkist --benchmark-skip \
ndcube: ndcube \
xdist: -n auto \
pyargs: {toxinidir}/docs --pyargs gwcs \
jwst: --pyargs jwst --ignore-glob=timeconversion --ignore-glob=associations --ignore-glob=scripts --show-capture=no \
romancal: --pyargs romancal \
romanisim: --pyargs romanisim \
cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing --cov-report=xml \
{posargs}

[testenv:build-docs]
description = invoke sphinx-build to build the HTML docs
extras = docs
commands =
sphinx-build -W docs docs/_build

[testenv:build-dist]
description = build wheel and sdist
skip_install = true
deps =
build
commands =
python -m build .

[testenv:specutils]
change_dir = {env_tmp_dir}
allowlist_externals =
git
bash
extras =
commands_pre =
bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt"
git clone https://github.com/astropy/specutils.git
pip install -e specutils[test]
pip install -r {env_tmp_dir}/requirements.txt
pip list
commands =
pytest specutils

[testenv:dkist]
change_dir = {env_tmp_dir}
allowlist_externals =
git
bash
extras =
commands_pre =
bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt"
git clone https://github.com/DKISTDC/dkist.git
pip install -e dkist[tests]
pip install -r {env_tmp_dir}/requirements.txt
pip list
commands =
pytest dkist --benchmark-skip

[testenv:ndcube]
change_dir = {env_tmp_dir}
allowlist_externals =
git
bash
extras =
commands_pre =
bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt"
git clone https://github.com/sunpy/ndcube.git
pip install -e ndcube[all,tests]
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest ndcube
Loading