Skip to content

fix: gate optax to python>=3.11 in the jax extra - #1426

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/optax-python-marker
Jul 27, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/optax-python-marker

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Hotfix for a regression I introduced in PyAutoGalaxy#530.

What broke

#530 pointed autogalaxy[jax] at autofit[jax] so optax follows the jax chain — correct for 3.11+, and it closed a real user-facing gap (pip install autolens[jax] previously did not get optax, so af.MultiStartAdam / af.MultiStartProdigy raised ImportError).

But autofit[jax] declared optax with no Python marker, while every entry in autonerves[jax] carries python_version >= '3.11'. So on 3.9/3.10 the extra suddenly asked pip to find an optax for an interpreter recent optax has no wheels for, and pip backtracked through the optax/jax release history until:

error: resolution-too-deep
× Dependency resolution exceeded maximum depth

That took every 3.9 leg of python_matrix red — PyAutoNerves, PyAutoArray, PyAutoGalaxy and PyAutoLens — legs that were green in the pre-merge run.

Fix

Give optax the same marker the rest of the jax family already has:

-jax = ["autonerves[jax]", "optax>=0.2.5"]
+jax = ["autonerves[jax]", "optax>=0.2.5; python_version >= '3.11'"]

optax is only useful where jax is installed, and jax is already gated to 3.11+, so gating optax to match loses nothing on 3.9/3.10 and keeps #530's intended fix fully intact on 3.11+.

API Changes

None. Packaging metadata only, and strictly narrowing: the jax extra resolves exactly as it did before #530 on 3.9/3.10, and exactly as #530 intended on 3.11+.

Verification

Built wheel metadata from this branch:

Requires-Dist: autonerves[jax]; extra == "jax"
Requires-Dist: optax>=0.2.5; python_version >= "3.11" and extra == "jax"

Marker evaluation across the matrix:

py3.9  -> False      py3.11 -> True
py3.10 -> False      py3.12 -> True
                     py3.13 -> True

Lesson

An unmarked dependency added to an extra whose every other member is version-gated does not just fail to install — it can make the whole resolution unsolvable on the excluded interpreters. Marker parity within an extra is load-bearing.

PyAutoGalaxy#530 pointed autogalaxy[jax] at autofit[jax] so optax follows the
jax chain. That was right for 3.11+, but autofit[jax] declared optax with no
Python marker, while every entry in autonerves[jax] carries
python_version >= '3.11'. So on 3.9/3.10 the extra suddenly asked pip to find
an optax for an interpreter recent optax has no wheels for, and pip backtracked
through the optax/jax release history until:

    error: resolution-too-deep

That took every 3.9 leg of python_matrix red (PyAutoNerves, PyAutoArray,
PyAutoGalaxy, PyAutoLens) — legs that were green before the merge. My
regression.

optax is only useful where jax is installed and jax is already gated to 3.11+,
so giving optax the same marker loses nothing and restores the pre-merge
resolution on 3.9/3.10.

Verified in the built wheel metadata:
  Requires-Dist: optax>=0.2.5; python_version >= "3.11" and extra == "jax"
and by marker evaluation: 3.9/3.10 -> False, 3.11/3.12/3.13 -> True.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 3a467a5 into main Jul 27, 2026
5 checks passed
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 27, 2026
@Jammy2211
Jammy2211 deleted the feature/optax-python-marker branch August 25, 2026 18:13
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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