Skip to content

feat: run on Python 3.13 on Linux - #117

Open
ncaq wants to merge 2 commits into
utensils:mainfrom
ncaq:python-version
Open

ncaq wants to merge 2 commits into
utensils:mainfrom
ncaq:python-version

Conversation

@ncaq

@ncaq ncaq commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Upstream ComfyUI calls Python 3.13 "very well supported" and ships it in its portable builds,
and it is the default Python of nixpkgs.
Linux moves from 3.12 to 3.13.
macOS stays on 3.12,
because the pinned PyTorch 2.5.1 has no cp313 wheel for macOS.
The interpreter is now selected in one place,
nix/python.nix.

Interpreter-specific wheel pins in nix/versions.nix become a URL template,
with one hash per interpreter tag.
nix/python-overrides.nix derives the tag from the selected Python,
so the next bump only has to add hashes.
A new wheel-pins check fails evaluation when a pin lacks the hash for the selected Python.

The launcher derives the venv paths from the interpreter instead of hardcoding python3.12.
It rewrites pyvenv.cfg and the interpreter links on every start,
since both name a store path that changes with each update.
It also prints a note when site-packages of another Python version are left in the venv,
because packages installed by ComfyUI-Manager under 3.12 are not visible to 3.13.

The bundled PyAV wheel goes from 17.0.0 to 17.0.1.
With 17.0.0 on Python 3.13,
imageio's test_lagging_video_stream hangs and fails the build every time.

Overrides that Linux no longer needs on nixpkgs' default Python are reduced.
On Linux the affected packages now come from the binary cache,
or build with their test suites enabled.

  • macOS only, grouped in one block: open-clip-torch, torchmetrics, inline-snapshot, backrefs
  • macOS only, same block: jupyter-server, ultralytics, mss, filterpy
  • Only where PyTorch comes from a pre-built wheel: timm, torchsde
  • Removed: albumentations, which nixpkgs dropped
  • Removed: bitsandbytes, which nixpkgs already builds with ninja
  • Removed: allowBrokenPredicate for open-clip-torch, which is no longer marked broken

Tested on x86_64-linux with an RTX 5090.

  • nix flake check passes, building the CPU, CUDA, ROCm 7.1 and XPU packages
  • The ROCm 7.2 package builds
  • The CUDA package starts and loads all bundled custom nodes
  • It registers the same 1693 nodes as the 3.12 build
  • A model-free workflow that saves PNG and h264 output succeeds

macOS is only verified to evaluate.
The PyAV bump and the allowBrokenPredicate removal also affect it.

Upstream ComfyUI calls Python 3.13 "very well supported" and ships it in its portable builds,
and it is the default Python of nixpkgs.
Linux moves from 3.12 to 3.13.
macOS stays on 3.12,
because the pinned PyTorch 2.5.1 has no cp313 wheel for macOS.
The interpreter is now selected in one place,
`nix/python.nix`.

Interpreter-specific wheel pins in `nix/versions.nix` become a URL template,
with one hash per interpreter tag.
`nix/python-overrides.nix` derives the tag from the selected Python,
so the next bump only has to add hashes.
A new `wheel-pins` check fails evaluation when a pin lacks the hash for the selected Python.

The launcher derives the venv paths from the interpreter instead of hardcoding `python3.12`.
It rewrites `pyvenv.cfg` and the interpreter links on every start,
since both name a store path that changes with each update.
It also prints a note when site-packages of another Python version are left in the venv,
because packages installed by ComfyUI-Manager under 3.12 are not visible to 3.13.

The bundled PyAV wheel goes from 17.0.0 to 17.0.1.
With 17.0.0 on Python 3.13,
imageio's `test_lagging_video_stream` hangs and fails the build every time.

Overrides that Linux no longer needs on nixpkgs' default Python are reduced.
On Linux the affected packages now come from the binary cache,
or build with their test suites enabled.

- macOS only, grouped in one block: open-clip-torch, torchmetrics, inline-snapshot, backrefs
- macOS only, same block: jupyter-server, ultralytics, mss, filterpy
- Only where PyTorch comes from a pre-built wheel: timm, torchsde
- Removed: albumentations, which nixpkgs dropped
- Removed: bitsandbytes, which nixpkgs already builds with ninja
- Removed: `allowBrokenPredicate` for open-clip-torch, which is no longer marked broken

Tested on x86_64-linux with an RTX 5090.

- `nix flake check` passes, building the CPU, CUDA, ROCm 7.1 and XPU packages
- The ROCm 7.2 package builds
- The CUDA package starts and loads all bundled custom nodes
- It registers the same 1693 nodes as the 3.12 build
- A model-free workflow that saves PNG and h264 output succeeds

macOS is only verified to evaluate.
The PyAV bump and the `allowBrokenPredicate` removal also affect it.
Copilot AI balanced review requested due to automatic review settings November 10, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The manual-linting heading in CLAUDE.md is joined to the wheel-pins bullet, making the manual commands appear to belong to the CI-check list.

1 open issue
What changed in this PR

Moves Linux builds to Python 3.13 while keeping macOS on Python 3.12 for compatibility with its pinned PyTorch wheels.

Changes:

  • Centralizes interpreter selection and adds interpreter-specific wheel hashes with an evaluation check.
  • Updates launcher virtual-environment paths and interpreter links, with guidance for reinstalling older dependencies.
  • Upgrades PyAV to 17.0.1 and narrows package overrides that Linux no longer needs.
File Description
README.md Updates the documented Python versions.
pyproject.toml Updates the project description to Python 3.13.
nix/​versions.nix Adds wheel URL templates and Python 3.13 hashes.
nix/​python.nix Centralizes platform-specific interpreter selection.
nix/​python-overrides.nix Resolves wheel pins, upgrades PyAV, and narrows overrides.
nix/​packages.nix Adapts the launcher and virtual environment to the selected Python.
nix/​checks.nix Adds wheel-hash validation and adjusts the mss assertion.
flake.nix Uses shared interpreter selection and removes obsolete broken-package allowances.
CLAUDE.md Documents interpreter selection and the wheel-pin check.
CHANGELOG.md Records the migration and dependency changes.

Review effort: Balanced

Comment thread CLAUDE.md Resolved
The `wheel-pins` bullet in `CLAUDE.md` had lost its trailing newline,
so the "Manual linting in dev shell" heading rendered as part of that check's description.
The manual commands below it then looked like entries of the CI check list.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The PyAV update and override changes still require a native macOS build and import smoke test against the retained Python 3.12 runtime and pinned PyTorch 2.5.1 stack.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants