fix(deps): make torch/torchvision installable on macOS - #193
Merged
Merged
Conversation
torch/torchvision were pinned to the `+cpu` builds from the PyTorch CPU index, which only publishes those builds for Linux. `poetry install` therefore failed on macOS. Declare them per platform: Linux keeps the `+cpu` builds (Docker/prod unchanged), macOS uses the same versions from PyPI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sandragjacinto
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
poetry installfails on macOS (e.g. Apple Silicon laptops), so the API can't be run locally on a Mac:torchandtorchvisionare pinned to2.9.1+cpu/0.24.1+cpufrom thepytorch_cpuindex. PyTorch only publishes the+cpubuilds for Linux (and Windows); on macOS the CPU build is simply the plain2.9.1wheel, so there is nothing for Poetry to install.Fix
Declare both packages per platform in
pyproject.toml:+cpufrompytorch_cpu, exactly as before (Docker / staging / prod unaffected)2.9.1/0.24.1) from PyPIThe macOS entry needs an explicit
source = "pypi": without it, Poetry treats2.9.1+cpuas satisfying2.9.1and still picks the Linux-only build on Mac.About the
poetry.lockdiffRe-generated with Poetry 2.2.1 (the version that produced the current lockfile). The lock has to be committed alongside
pyproject.toml, otherwisepoetry installrefuses to run. Changes are additive only:torch/torchvisionnvidia-*,triton), whose markers resolve toLinux and darwin— i.e. they are never installed on any platformHow to test
poetry installthenmake run-poetry→/docsreturns 200 (verified locally)torch 2.9.1+cpu🤖 Generated with Claude Code