Open3

uv add において --index-strategy unsafe-best-match が効いていないように見える

hirogahiroga

問題のコマンド

$ uv add markupsafe --index-url https://download.pytorch.org/whl/cu124 --index-strategy unsafe-best-match --verbose
hiroga@hiroga-air test % uv add markupsafe --index-url https://download.pytorch.org/whl/cu124 --index-strategy unsafe-best-match --verbose 
DEBUG uv 0.4.25 (Homebrew 2024-10-21)
warning: Indexes specified via `--index-url` will not be persisted to the `pyproject.toml` file; use `--default-index` instead.
DEBUG Found project root: `/Users/hiroga/Documents/GitHub/uv/test`
DEBUG Project is contained in non-workspace project: `/Users/hiroga/Documents/GitHub/uv`
DEBUG No workspace root found, using project root
DEBUG Reading requests from `/Users/hiroga/Documents/GitHub/uv/test/.python-version`
DEBUG The virtual environment's Python version satisfies `Python 3.12.7`
DEBUG Using request timeout of 30s
DEBUG No changes to dependencies; skipping update
DEBUG Using request timeout of 30s
DEBUG Found static `pyproject.toml` for: test @ file:///Users/hiroga/Documents/GitHub/uv/test
DEBUG Project is contained in non-workspace project: `/Users/hiroga/Documents/GitHub/uv`
DEBUG No workspace root found, using project root
DEBUG Existing `uv.lock` satisfies workspace requirements
Resolved 2 packages in 3ms
error: Distribution `markupsafe==3.0.2 @ registry+https://download.pytorch.org/whl/cu124` can't be installed because it doesn't have a source distribution or wheel for the current platform

hirogahiroga

たしかに2024-11-04時点では、https://download.pytorch.org/whl/cu124 に存在する markupsafe のビルドは MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl のみとなっている。uvはPython versionを無視してこのバージョンのインストールを試みているように見える。