Skip to content

[ci][deps] Compile requirements_compiled_py3.14.txt from markers instead of by hand - #66795

Merged
elliot-barn merged 6 commits into
masterfrom
elliot-barn/py314-marker-constraints
Oct 9, 2026
Merged

elliot-barn merged 6 commits into
masterfrom
elliot-barn/py314-marker-constraints

Conversation

@elliot-barn

@elliot-barn elliot-barn commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Why

python/requirements_compiled_py3.14.txt is edited by hand. It copied most pins from the py3.11 lock, and only six were ever bumped for 3.14. About 25 other pins have no cp314 wheel (jax 0.4.33, h5py 3.12.1, pymongo 4.3.2, tensorflow 2.20, ...), and transformers was still at 4.36.2. Nobody noticed, because a constraints file only gets tested when some image actually requests a package. Once #65909 made the ray-torch py3.14 depset constrain on this file, the nightly ray-torch.py3.14 build failed on tokenizers==0.15.2 (no cp314 wheel).

Not a duplicate: #66731 fixes the same failure with a uv --override file. An override replaces every requirement on a package, including the version bounds other packages declare, so conflicts compile cleanly. Its generated file pins s3torchconnector 1.4.3 with s3torchconnectorclient 1.5.0, numcodecs 0.17 against zarr's <0.16, and numpy 2.3.3 against lerobot's <2.3. This PR takes a different approach and uses no overrides, so uv enforces every dependent's bounds.

What changed

  • ci/ci.sh compile_pip_dependencies_py314 compiles the 3.14 file on its own, like compile_313_pip_dependencies did before [ci][deps] Unify requirements_compiled across Python versions #64257. It uses uv 0.9.26 (the version bazel pins) with --python-version 3.14, from the same source files as compile_pip_dependencies.
    • Wheels only (--only-binary :all:), except 12 packages that ship only an sdist for every Python version, so building them isn't a 3.14 regression.
    • Ray images are glibc 2.35, so it targets manylinux_2_35.
  • Where a shared pin has no cp314 wheel, the source file gates it. The pinned line gets python_version < '3.14'. Where 3.14 needs a replacement, an unpinned python_version >= '3.14' line is added and the resolver picks the version. This replaces the py313/ directory copies 3.13 used to have.
  • Source builds: the 3.14 compile uses --only-binary :all:, so a package without a cp314 wheel fails the compile instead of quietly building from source. The exceptions are packages that never ship a wheel on any Python: sdist-only releases (crcmod, gsutil, ...) and hyperopt, which tune-requirements.txt pins to a git commit. Every Python builds those from source; the 3.10–3.13 compile just doesn't forbid it.
  • The dependencies pipeline now fails if requirements_compiled_py3.14.txt is out of date, the same check it already runs on the main file.
  • requirements_compiled.txt: marker-only changes (python_version < "3.14").
  • Non-3.14 deplocks: 38 files change, marker annotations only. No versions change.
  • Docs: dependency-management.md gets a Python 3.14 section.

3.14 decisions (source files)

Change Packages
Own pin on 3.14 (shared pin has no cp314 wheel; a >= '3.14' line pins the version that resolved) numpy, numba, llvmlite, cupy-cuda12x, cffi, jax/jaxlib, h5py, mujoco, ale-py, pymunk, open-spiel, pymongo, tensordict, crc32c, pyiceberg, s3torchconnector, pytest
Not installed on 3.14 (no usable release) tensorflow, tf-keras, torchtext, pygame, minigrid, supersuit, tinyscaler, datasketches, fastrlock (cupy 14 dropped it), raydp (pins netifaces 0.11.0)
Not installed on 3.14 (blocked by a dependency) zarr + numcodecs (every zarr 2.x needs numcodecs <0.16; none has cp314 wheels), lerobot (every release caps numpy <2.3)

Notes for reviewers:

  • Versions follow the existing 3.14 file: uv keeps a pin from it whenever that pin still installs. numpy 2.3.3, numba 0.65.0, llvmlite 0.47.0, cupy 14.0.1 and pytest 8.3.3 stay where they were. Pins that had to move go to the latest release, e.g. transformers 5.19.0 (3.11 has 5.11.0) and jax 0.11.2.
  • pytest 8.3.3 isn't needed for the reason [ci][deps] Add py3.14 TPU base deps and refresh py3.14 locks #64750 gave: pytest 7.4.4 only uses ast.Str below Python 3.8. It's needed because locust ≥2.40 requires it, and older locust caps gevent<25.8.1, which has no cp314 wheel.
  • urllib3 goes from 2.0.7 back to 1.26.20. [ci][deps] Add py3.14 TPU base deps and refresh py3.14 locks #64750 pinned 2.0.7 by hand with no stated reason. 1.26.20 imports and makes requests on CPython 3.14 with DeprecationWarnings turned into errors.
  • Marker gotcha: pip-compile writes the marker of the last source line, in compile order, that has a marker matching py3.11. Lines without a marker are ignored. Gating a bare tf-keras line after the pinned one rewrote tf-keras==2.19.0's marker from < "3.12" to < "3.14", which would have applied that pin on 3.12/3.13. So those lines are split at 3.12.
  • Tests that can't run on 3.14: with zarr, lerobot, datasketches, raydp, tensorflow and the RL env packages dropped, the tests that use them need 3.14 skips once 3.14 test jobs exist.

User-visible change (py3.14 images)

  • ray-torch py3.14: transformers 4.57.6 → 5.19.0 (tokenizers 0.23.2, huggingface-hub 1.33.0).
  • All py3.14 image locks now install from wheels only, apart from packages that have never shipped a wheel.
Full diff of requirements_compiled_py3.14.txt pins vs master (108 packages)

Changed (35): accelerate 0.28.0→1.15.0, ale-py 0.10.1→0.12.1, array-record 0.5.1→0.8.3, click 8.3.2→8.5.0, crc32c 2.3→2.9.post0, cryptography 44.0.3→47.0.0, datasets 3.6.0→4.8.5, etils 1.5.2→1.14.0, evaluate 0.4.3→0.4.6, h5py 3.12.1→3.16.0, hf-xet 1.4.3→1.7.0, huggingface-hub 0.36.2→1.33.0, jax 0.4.33→0.11.2, jaxlib 0.4.33→0.11.2, mlflow / mlflow-skinny / mlflow-tracing 3.11.1→3.16.1, mujoco 3.2.4→3.15.0, onnx 1.16.0→1.23.2, open-spiel 1.4→2.0.2, py-spy 0.4.1→0.4.2, pyiceberg 0.11.0→0.12.0, pymongo 4.3.2→4.18.2, pymunk 6.2.1→7.3.0, pyopenssl 25.1.0→26.2.0, s3torchconnector 1.4.3→1.5.0, s3torchconnectorclient 1.4.3→1.5.0, safetensors 0.7.0→0.8.0, sentencepiece 0.1.96→0.2.1, snowflake-connector-python 4.3.0→4.8.0, tensordict 0.8.3→0.14.2, tokenizers 0.15.2→0.23.2, transformers 4.36.2→5.19.0, urllib3 2.0.7→1.26.20 (+ deepspeed marker only)

Added (13), all already in the shared sources: audioop-lts, av, cuda-pathfinder, hf-gradio, mcap, obstore, onnx-ir, onnxscript, pymysql, pyvers, ray-haproxy, taskiq-redis, torchcodec

Removed (60): the gated packages above and what only they pull in (tensorflow stack, RL envs, aim/mosaicml/hpbandster/uvloop which the sources already gate to <3.12), plus stale entries no current source requires (sphinx/myst/ruff family).

Testing

Run on x86_64 Linux in a Python 3.11 venv:

  • ci/ci.sh compile_pip_dependencies, then ci/ci.sh compile_pip_dependencies_py314, then bazelisk run //ci/raydepsets:raydepsets -- build --all-configs. All succeed.
  • Running compile_pip_dependencies_py314 a second time reproduces the committed file byte for byte, so the new CI check passes. This was also checked with UV_NO_CACHE=1, which is how CI runs it: a warm local uv cache had hidden the hyperopt failure below.
  • Wheels-only install check: each regenerated py3.14 lock passes uv pip compile --no-deps --python-version 3.14 --python-platform x86_64-manylinux_2_35 --only-binary :all: (minus the sdist-only list). That covers base_deps, base_extra, base_extra_testdeps, base_slim, ray_img, ray_img_cu130 and ray-torch.
  • No version changes on other Pythons: the pin sets of all 38 changed non-3.14 locks are identical to master, ignoring markers.
  • pytest 7.4.4 and urllib3 1.26.20 were checked on CPython 3.14.3.

Not changed here

  • datasketches in base-extra: docker/base-extra/requirements.in lists it directly, so the base-extra py3.14 image still builds it from source, same as master.
  • TPU py3.14 lock: it doesn't use this constraints file, and tensorboard-plugin-profile there has no cp314 wheel.

AI assistance (Claude Code) was used to investigate and write this change.

🤖 Generated with Claude Code

elliot-barn and others added 2 commits October 6, 2026 22:47
…ead of by hand

requirements_compiled_py3.14.txt was edited by hand and drifted: it pinned
packages with no cp314 wheel (tokenizers 0.15.2 via transformers 4.36.2,
tensorflow 2.20, ...), which broke the nightly ray-torch py3.14 build once
#65909 made that depset constrain on it.

- Source requirement files express every 3.14 difference with
  python_version markers: a newer pin where the shared one has no cp314
  wheel, or a < '3.14' gate where no release has one.
- ci/ci.sh compile_pip_dependencies_py314 compiles the file with uv,
  wheels only (bar a short list of sdist-only packages), constrained to
  requirements_compiled.txt minus the pins that are marker-gated off 3.14
  (ci/py314_parity_constraints.py). No --override, so dependents' version
  bounds still apply and conflicts fail the compile.
- The dependencies pipeline checks the file is current, like the main one.
- requirements_compiled.txt changes are marker-only; non-3.14 deplocks
  change only in markers, no versions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Compile requirements_compiled_py3.14.txt as a separate uv compile, like
compile_313_pip_dependencies did, instead of constraining it to
requirements_compiled.txt. The 3.14 branch lines in the source files are
now unpinned, and the cryptography/pyopenssl/snowflake splits that only
existed for parity are gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn marked this pull request as ready for review October 9, 2026 06:21
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

The number of changes in this pull request is too large for Gemini Code Assist to generate a review.

elliot-barn and others added 3 commits October 9, 2026 06:31
The `python_version >= '3.14'` halves of each marker pair were unpinned.
Pin them to the versions already in requirements_compiled_py3.14.txt so
they read like the rest of the source files and a re-resolve can't move
them silently. Recompiling requirements_compiled_py3.14.txt is a no-op.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
…arker-constraints

Signed-off-by: elliot-barn <[email protected]>

# Conflicts:
#	python/deplocks/ci/data-mongo-ci_depset_py3.10.lock
#	python/deplocks/ci/data-pyarrow-latest-ci_depset_py3.10.lock
#	python/deplocks/ci/data-pyarrow-latest-ci_depset_py3.12.lock
#	python/deplocks/ci/data-pyarrow-nightly-ci_depset_py3.10.lock
#	python/requirements/ml/data-test-requirements.txt
…master

Comment-only: master's data-test-requirements now lists azure-storage-blob
and databricks-sdk directly, which updates their `# via` lines.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn elliot-barn added the go add ONLY when ready to merge, run all tests label Oct 9, 2026
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Oct 9, 2026
hyperopt is pinned to a git commit, so uv can only get it by building it.
`--only-binary :all:` rejected it in CI ("Building source distributions for
`hyperopt` is disabled"). Local runs passed only because uv had hyperopt's
metadata cached; with UV_NO_CACHE=1 the failure reproduces, and with this
change the compile succeeds and the lock is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn merged commit 990ff9f into master Oct 9, 2026
6 checks passed
@elliot-barn
elliot-barn deleted the elliot-barn/py314-marker-constraints branch October 9, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant