Skip to content

Require Python 3.12, and bound every dependency floor by what Pyodide ships - #399

Merged
neuromechanist merged 8 commits into
developfrom
chore/python-312-floor
Sep 21, 2026
Merged

neuromechanist merged 8 commits into
developfrom
chore/python-312-floor

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Pyodide 0.29.5 runs CPython 3.13.2, so the browser is the newest interpreter eegprep has to
satisfy, not the oldest. That inverts the usual reading of these settings: requires-python and
the dependency floors act as a ceiling for the browser target, because Pyodide bundles its own
build of every compiled package and micropip has no WebAssembly fallback when a floor sits above it.

This raises the floor to Python 3.12 and moves every dependency floor up to, but not past, what
Pyodide 0.29.5 ships.

What changed

  • requires-python = ">=3.12", .python-version 3.12, ruff and ty targets 3.12

  • CI matrix ["3.10", "3.11", "3.12"] becomes ["3.12", "3.13"], and every single-interpreter job
    moves off 3.11

  • Dependency floors raised, each at or below the Pyodide 0.29.5 build:

    package Pyodide 0.29.5 ships new floor
    numpy 2.2.5 >=2.1.0
    scipy 1.14.1 >=1.14.1
    matplotlib 3.8.4 >=3.8.0
    h5py 3.13.0 >=3.12.1
    threadpoolctl 3.5.0 >=3.5.0

    macOS takes scipy>=1.16.3 through a sys_platform marker, because scipy built before 1.16.3
    fails to dlopen on current macOS. Pyodide reports sys_platform == "emscripten", so the
    browser takes the 1.14.1 branch and the macOS floor never applies there.

  • The tomli backport retires with the 3.10 floor, along with its try/except tomllib shims

  • README badge, AGENTS.md, four docs pages and the six example extensions move to 3.12

A guard for the constraint, because the existing one does not check versions

epic/324-pyodide-browser carries tools/check_pyodide_base_resolution.py for exactly this, and
it does not work: it matches package names against the Pyodide lock and never compares
versions. That branch declares threadpoolctl>=3.6.0 today against a distribution shipping 3.5.0,
and running the gate prints [ok] threadpoolctl==3.6.0: pyodide-lock. Filed as #400.

tests/test_browser_dependency_floors.py closes that on develop, offline, against the versions
Pyodide 0.29.5 bundles. It was verified non-vacuous by reintroducing the real bug: >=3.6.0 fails
two tests by name, and a requires-python of >=3.14 fails the interpreter check.

Also in here, from review

  • The 3.13 CI job failed on MathWorks' engine (supports Python version 3.9, 3.10, 3.11, and 3.12),
    not on eegprep. uv sync succeeded on 3.13. The workflow already treats MATLAB as optional and
    falls through to a plain pytest run, but the install aborted the job first; it is now tolerated.
  • development.rst told readers to build the parity harness on 3.11 and pip install -e this tree
    into it, which the new floor breaks. That was a broken instruction, not just a stale claim.
  • pre-commit.py reported OK while skipping every YAML file when pyyaml was missing, the same
    false green the tomli removal fixed for TOML.
  • python_requires in the catalog validator had no test at all, unlike its eegprep_requires
    sibling; it now has the unsatisfiable-floor and malformed-specifier cases. The happy-path fixture
    went back to a value no interpreter bump can disturb.

Verification

  • Full offline suite on 3.12: 2711 passed, plus the pre-existing torch-extra failure
  • 3.13 collects clean: 3447 tests, no collection errors, no filterwarnings-as-errors config
  • ruff check, ruff format --check, ty check clean apart from three pre-existing unresolved
    torch imports in an environment without that extra
  • ./pre-commit.py --all-files OK over 1221 files

Notes

  • sympy is already absent from develop; Fix the resampling ratio for non-integer sampling rates, and drop sympy #397 removed it. Nothing in this diff changes that.
  • macOS and Windows stay on 3.12 only. 3.12 is the floor and Ubuntu covers 3.13, which is the
    Pyodide interpreter, so a macOS 3.13 job would spend CI on a combination neither the floor nor
    the browser target uses.
  • importlib.abc.Traversable at guifunc/pophelp.py:6 is deprecated and removed in 3.14. Not a
    problem for this PR; it needs handling before any future 3.14 bump.

Closes nothing on its own; supports #324 and #395.

The browser target sets this, in the opposite direction to the obvious
one. Pyodide 0.29.5 ships CPython 3.13.2 and its wheels are cp313, so
requires-python is a ceiling rather than a floor: 3.14 would make
eegprep uninstallable in the browser until Pyodide moves. 3.12 keeps one
version of headroom and lets CI cover both 3.12 and the 3.13 the browser
actually runs.

The matrix drops 3.10 and 3.11 and gains 3.13. tomllib has been in the
standard library since 3.11, so the tomli backport and its two
try/except shims are dead code and go with it.
Two of these are live bugs rather than tidying.

threadpoolctl was declared >=3.6.0 while Pyodide 0.29.5 ships 3.5.0, so
the floor is above what the browser can provide and a browser install
cannot satisfy it. matplotlib>=3.9.2 would have introduced the same bug,
since Pyodide has 3.8.4; 3.8.0 is the newest floor that does not.

The rest were fiction in the other direction: numpy>=1.20 ships cp37
through cp39 wheels and cannot install on the Python this package now
requires. Floors are now the first release with real 3.12 support,
capped by the version Pyodide ships: numpy 2.1.0, scipy 1.14.1,
matplotlib 3.8.0, h5py 3.12.1, threadpoolctl 3.5.0.

scipy is split by platform. 1.14.1 is exactly what Pyodide has, so the
general floor cannot go higher, but scipy built before 1.16.3 fails to
dlopen on current macOS with a zero-fill section error, so darwin gets
its own floor.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, reopen this pull request to trigger a review.

@claude

claude Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

The 3.12 floor landed in the test matrix but not in the jobs that
install a single interpreter, so docs, release, ruff/ty, and the
Claude workflows all still asked for 3.11 and uv refused:

  error: The requested interpreter resolved to Python 3.11.16, which
  is incompatible with the project's Python requirement: `>=3.12`

Tested: the failing jobs were "Ruff and ty" and "Build Documentation".
The floor moved but the surrounding claims did not: the README badge,
the AGENTS notes, four docs pages, and the six example extensions all
still advertised 3.10 or 3.11, and ty was still type-checking against
3.10 semantics.

pre-commit.py carried a tomli backport for 3.10 and a matching
"tomli is not installed; skipping TOML syntax checks" branch. On a
3.12 floor tomllib is always stdlib, so both are dead, and the branch
was a silent skip of a check the script claims to run.

Tested: ruff check and format clean, ty clean apart from three
pre-existing unresolved torch imports (the local venv has no torch
extra), tests/test_extension_catalog.py 22 passed, and
./pre-commit.py --all-files reports OK with config syntax checked.
The 3.13 job failed on the MATLAB engine install, not on eegprep:

  MATLAB Engine for Python supports Python version 3.9, 3.10, 3.11,
  and 3.12, but your version of Python is 3.13

uv sync had already succeeded, so every dependency floor resolves on
3.13; only MathWorks' engine has no build for it. The workflow already
treats MATLAB as optional and falls through to a plain pytest run when
the engine will not start, but the install step aborted the job before
reaching that check. Tolerate the install failing so the fall-through
runs, which also means this starts working by itself once a MATLAB
release covers 3.13, rather than encoding a compatibility table in CI.
development.rst told the reader to build the parity harness venv with
--python 3.11 and then pip install -e this working tree into it. Under
requires-python >=3.12 that install now fails, so the instruction was
not merely stale, it no longer worked.

Also split the two-sentence line in faq.rst onto its own lines, per the
semantic line break convention.
Removing the tomli backport fixed the TOML half of a false green: a
missing parser printed one warning, skipped every file of that type,
recorded no error, and let the run print OK. The YAML half was left
behind with the identical shape.

pyyaml is declared in this script's inline dependencies, so uv installs
it before the body runs and the only way to reach the fallback is to
start the script without uv. That is a misuse, not a degraded
environment, so it now exits with the invocation to use instead of
quietly checking nothing.

Also corrects the header, which still said config parsing happens "when
dependencies are available". It is now unconditional.

Tested: ./pre-commit.py --all-files reports OK over 1221 files with
config syntax checked.
Pyodide bundles its own build of every compiled package, so a floor
above what a Pyodide release ships cannot be satisfied in the browser.
That makes these floors and requires-python a ceiling, which is the
opposite of how a floor reads and is invisible from the code.

The epic branch's tools/check_pyodide_base_resolution.py was supposed
to catch this and does not: it matches package names against the
Pyodide lock and never compares versions, so threadpoolctl>=3.6.0 sits
on that branch today against a distribution shipping 3.5.0, and the
gate calls it ok. Filed as #400.

These tests close the gap on develop, offline, against the versions
Pyodide 0.29.5 bundles. Verified non-vacuous by reintroducing the real
bug: threadpoolctl>=3.6.0 fails two of them by name, and a
requires-python of >=3.14 fails the interpreter check, since Pyodide
runs CPython 3.13.2.

Also records the constraint above the floors it governs, which was
documented for scipy alone, and bumps the ruff target to py312, missed
when the ty target moved.

The catalog fixture's python_requires went back to a value no
interpreter bump can disturb; pinning it to the project floor coupled
an unrelated happy path to every future bump. The field's real
behavior, an unsatisfiable floor and a malformed specifier, now has the
two tests its eegprep_requires sibling already had and it did not.
@neuromechanist
neuromechanist merged commit aca0a22 into develop Sep 21, 2026
8 checks passed
@neuromechanist
neuromechanist deleted the chore/python-312-floor branch September 21, 2026 04:23
neuromechanist added a commit to nemarOrg/nemar-cli that referenced this pull request Sep 21, 2026
Two entries, both from sccn/eegprep#399.

The Pyodide ceiling: for a browser-bound package, requires-python and
every dependency floor cap at what the Pyodide release ships, because
micropip has no WebAssembly build to fall back to. This inverts how a
floor normally reads and is invisible from the code, which is how
threadpoolctl>=3.6.0 reached the epic branch against a distribution
shipping 3.5.0. Carries the verified 0.29.5 version table and the
warning that the epic branch's own gate compares names, not versions.

The MATLAB engine ceiling: each MATLAB release covers a fixed set of
Python versions, so adding 3.13 to the matrix went red on MathWorks'
engine install while uv sync had already succeeded. The obvious reading
is that the new Python broke the package, and that reading is wrong.
neuromechanist added a commit that referenced this pull request Sep 21, 2026
I claimed threadpoolctl>=3.6.0 was a live browser-install bug against a
Pyodide shipping 3.5.0. It is not. threadpoolctl publishes a
py3-none-any wheel, so micropip pulls any version straight from PyPI
and never touches the bundled build. The floor costs a download, not an
install.

The constraint is real only where no pure-Python wheel exists, because
then Pyodide's build is the only one a browser can have. Checked
against PyPI: numpy, scipy, h5py and matplotlib publish none, so their
floors genuinely are a ceiling; threadpoolctl does, so its floor is not
constrained this way.

So the test now enforces the four compiled packages and records
threadpoolctl in PYODIDE_PURE_PYTHON, deliberately unenforced, with the
reason. Still verified non-vacuous: raising the non-darwin scipy floor
to 1.15.0, above the 1.14.1 Pyodide ships, fails three tests by name.

The four floors that shipped in #399 were correct and remain unchanged.
What was wrong was the stated reason for one of them. Correction also
filed on #400, whose original example was the same mistake.
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