Skip to content

build: add Python 3.13 to CI matrix across all repos #89

Closed

Description

@Jammy2211

Overview

Add Python 3.13 support to the CI test matrix for all five PyAuto library repos. Currently all CI runs only on Python 3.12. Since requires-python >= 3.12 already allows 3.13 installs, we need CI coverage to catch any 3.13-specific issues. The dependency sweep (#87) already raised version caps — JAX, numba, and all other deps support 3.13. AutoBuild will remain on 3.12 only per user request.

Plan

  • Add '3.13' to the Python version matrix in .github/workflows/main.yml for all five repos
  • Add "Programming Language :: Python :: 3.13" classifier to each pyproject.toml
  • Handle optional deps that lack 3.13 wheels: skip tensorflow-probability install on 3.13 (it's optional and not needed for core tests)
  • Push branches, let CI run on both 3.12 and 3.13, then iterate on any failures
  • Note: a previous feature/python-3.12-3.13 branch exists on 4 repos — we'll start fresh
Detailed implementation plan

Affected Repositories

  • PyAutoConf (primary)
  • PyAutoFit
  • PyAutoArray
  • PyAutoGalaxy
  • PyAutoLens

Work Classification

Library

Branch Survey

Repository Current Branch Dirty? Prior branch?
PyAutoConf main clean feature/python-3.12-3.13 exists
PyAutoFit main clean feature/python-3.12-3.13 exists
PyAutoArray main clean feature/python-3.12-3.13 exists
PyAutoGalaxy main clean feature/python-3.12-3.13 exists
PyAutoLens main clean none

Suggested branch: feature/python-313
Worktree root: ~/Code/PyAutoLabs-wt/python-313/

Implementation Steps

  1. For each repo, edit .github/workflows/main.yml:

    • Change python-version: ['3.12'] to python-version: ['3.12', '3.13']
  2. For each repo, edit pyproject.toml:

    • Add "Programming Language :: Python :: 3.13" to classifiers
  3. For PyAutoArray only: conditionally skip tensorflow-probability on 3.13 (no wheels). Either:

    • Use a matrix exclude, or
    • Install [optional] only on 3.12 and base deps on 3.13
  4. Push all branches and monitor CI results on both Python versions

  5. Fix any 3.13-specific failures that emerge

Key Files

  • PyAutoConf/.github/workflows/main.yml
  • PyAutoFit/.github/workflows/main.yml
  • PyAutoArray/.github/workflows/main.yml
  • PyAutoGalaxy/.github/workflows/main.yml
  • PyAutoLens/.github/workflows/main.yml
  • All five pyproject.toml files (classifiers only)

Known Compatibility

  • jaxnnls==1.0.1: pure Python, works on 3.13 (no compiled extensions)
  • JAX >=0.4.33: has 3.13 support
  • numba >=0.60: has 3.13 support (optional dep)
  • tensorflow-probability==0.25.0: NO 3.13 wheels (optional, skip on 3.13)

Original Prompt

Click to expand starting prompt

Can you add Python 3.13 to the Github actions of every PyAuto library repository, assess what errors or
bugs come up when they try to use 3.13, and then we will iterate on working out what to do
so that the package as a whole supports both 3.12 and 3.13.

When libraries are done, we'll then do an autobuild run, but at the end autobuild will still only run on
3.12 by default to avoid too many different actions and instances of things running.

Activity

  1. Jammy2211 commented on Apr 12, 2026

    @Jammy2211
    CollaboratorAuthor

    Smoke Test Results — 2026-04-12

    Workspace Passed Failed Total
    autofit_workspace 6 1 7
    autogalaxy_workspace 5 1 6
    autolens_workspace 6 1 7
    autolens_workspace_test 2 6 8

    All failures are pre-existing and unrelated to the Python 3.13 CI changes:

    • cookbooks/samples.py — test mode returns fewer samples than script expects
    • interferometer/* — simulator subprocess fails (missing interferometer data/deps)
    • aggregator/* — numerical precision ("probabilities do not sum to 1")
    • jax_likelihood_functions/* — JAX vmap tolerance mismatch + interferometer simulator
    • database/scrape/general.py — missing dataset file in SMALL_DATASETS mode

    Core functionality (autofit searches, galaxy imaging, lens modeling, multi-wavelength) all passes.

    PRs

  2. Jammy2211 commented on Apr 12, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped — 2026-04-12

    PRs

    Summary

    Added Python 3.13 to the CI matrix across all 5 PyAuto library repos. All repos now test on both 3.12 and 3.13 with fail-fast: false.

    Key fixes:

    • PyAutoFit: Environment markers for anesthetic (==2.8.14 on 3.12, >=2.9.0 on 3.13) to handle numpy 2.x requirement on 3.13. Fixed dict mutation during iteration in replace_promise(). Added test exclusions for astropy/anesthetic/numpy-type incompatibilities on 3.13.
    • PyAutoArray/Galaxy/Lens: Conditional dependency installation — optional extras on 3.12, numba-only on 3.13 (pynufft/tf-probability lack 3.13 wheels).

    Session Notes

    • The biggest challenge was anesthetic==2.8.14 requiring numpy<2.0.0, which has no Python 3.13 wheels. PEP 508 environment markers solved this cleanly.
    • Python 3.13's stricter dict mutation during iteration caught a real bug in recursion.py.
    • Several PyAutoFit test files are excluded on 3.13 due to dependency issues (astropy not installed, anesthetic importing removed pandas SettingWithCopyWarning, numpy 2.x float type changes). These could be addressed in future PRs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions