Skip to content

Update testing and CI: tox-uv, lowest-resolution oldestdeps, role-based job names - #324

Open
tepickering wants to merge 2 commits into
astropy:mainfrom
tepickering:update_testing
Open

tepickering wants to merge 2 commits into
astropy:mainfrom
tepickering:update_testing

Conversation

@tepickering

@tepickering tepickering commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

This updates the testing infrastructure to match astropy/astroplan#641, adapted to specreduce.

Testing infrastructure

  • tox-uv. tox now uses tox-uv, which tox installs automatically through requires. pip-specific settings are replaced with their uv equivalents: {list_dependencies_command} instead of pip freeze, and UV_EXTRA_INDEX_URL with unsafe-best-match so devdeps can mix nightly and PyPI packages. The git-installed devdeps (specutils, synphot) use pkg @ git+... syntax.
  • oldestdeps uses uv's lowest resolution. Every package is installed at the lowest version allowed, instead of relying on hand-written pins.
    • Minimums for direct dependencies come from pyproject.toml.
    • Minimums for transitive dependencies are in the new oldestdeps-constraints.txt, applied through UV_CONSTRAINT. Each is the first release after Python 3.12.0 came out (the rule is in the file's header), worked out across platforms with uv pip compile --universal.
  • CI reorganized. The default Python is 3.14 and job names describe roles instead of versions, so future Python bumps only change the tox envs and default_python:
    • Linux runs 3.12 and 3.13 with base dependencies.
    • New: Linux 3.12 with the oldest dependencies. oldestdeps wasn't run in CI before.
    • macOS and Windows run 3.14 (previously 3.12).
    • Linux 3.14 runs all dependencies, remote data and coverage.
    • devdeps moves to its own allowed-to-fail job on Python 3.15 (release candidate, installed by uv), with remote data.
    • The weekly pre-releases job is renamed to match.
  • No GUI windows during tests. The root conftest.py forces the Agg matplotlib backend.

Minimum versions

Testing the real minimums showed several didn't work:

  • numpy>=1.24 → >=1.26.0: 1.24 and 1.25 have no Python 3.12 builds.
  • gwcs (unbounded) → >=0.24.0: with specutils 2.0 and gwcs 0.22, creating a Spectrum without a spectral axis fails with UnitConversionError: 'pix' and '' (dimensionless) are not convertible.
  • synphot → >=1.3.post0, the first release with Python 3.12 wheels.
  • test extra: pytest>=7.4.0, pytest-astropy>=0.11.0, and photutils>=1.11 to match all. tox is dropped from the test extra: that extra is installed inside each tox environment, where tox isn't needed, and the lowest resolution would install an ancient tox there. A new dev extra (pip install -e ".[dev]") installs the test, docs and all extras together with tox and tox-uv for local development.
  • asdf-astropy>=0.8.0 is in the constraints file: older versions serialize units through VOUnit and warn that Angstrom is deprecated, which filterwarnings = error makes fatal.

Test change

test_from_asdf_raises_on_unsupported_transform now uses Scale | Polynomial1D rather than a bare Polynomial1D. With asdf < 4, a GWCS whose transform is a single model with a 1-D bounding box fails schema validation when written. to_asdf always writes a compound shift→polynomial, so users aren't affected.

Not included

  • Free-threaded Python job. photutils has no free-threaded wheels and can't be built on free-threaded Python (it uses the limited C API), and the test fixtures need it through SynthImage.add_poisson_noise(). It can be added once photutils supports free threading.

Testing

Run locally with tox:

Environment Result
py312-test-oldestdeps (numpy 1.26.0, astropy 6.0.0, scipy 1.14.1, matplotlib 3.10.0, specutils 2.0.0, gwcs 0.24.0, asdf 3.3.0, pytest 7.4.0) passes
py312-test, py313-test, py314-test, codestyle pass
py314-test-alldeps-cov, remote data passes (239 passed, 0 skipped)
py314-test-alldeps-predeps passes
py315-test-devdeps (Python 3.15.0rc2; astropy 8.1.dev, numpy 2.6.dev, scipy 2.0.dev) passes

linkcheck was not run locally.

🤖 Generated with Claude Code

- Use tox-uv; oldestdeps now uses uv's "lowest" resolution with
  oldestdeps-constraints.txt for transitive dependencies instead of
  hand-maintained pins. Replace pip-specific settings with uv equivalents.
- Reorganize CI: default Python 3.14, role-based job names, new
  oldest-dependencies job, macOS/Windows on 3.14, devdeps as a separate
  allowed-failure job on Python 3.15 with remote data.
- Raise minimums found broken by the lowest resolution: numpy>=1.26.0,
  gwcs>=0.24.0; add minimums for synphot, pytest, pytest-astropy and
  photutils in the test extra. Drop tox from the test extra.
- Use a compound model in test_from_asdf_raises_on_unsupported_transform,
  since asdf < 4 can't serialize a single model with a 1D bounding box.
- Force the Agg matplotlib backend in the root conftest.py.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@tepickering
tepickering requested a review from hpparvi September 25, 2026 10:02
@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.52%. Comparing base (4e330bc) to head (bb5e85d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #324   +/-   ##
=======================================
  Coverage   92.52%   92.52%           
=======================================
  Files          18       18           
  Lines        2341     2341           
=======================================
  Hits         2166     2166           
  Misses        175      175           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tox was dropped from the test extra because that extra is installed inside
each tox environment, where tox isn't needed. The new dev extra installs the
test, docs and all extras together with tox and tox-uv for local development.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant