astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
11.72k stars 321 forks source link

Defining index-url in pyproject.toml not working #3288

Closed florianfischer91 closed 2 weeks ago

florianfischer91 commented 2 weeks ago

First of all thanks for developing uv (and ruff). They are really amazing :-)

I was trying to set the index-url in a pyproject.toml, but im always getting the following error:

error: Failed to parse `pyproject.toml`
  Caused by: TOML parse error at line 2, column 5
  |
2 | Url="https://randomstring/simple"
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
invalid type: string "https://randomstring/simple", expected struct VerbatimUrl

Example to reproduce the bug, call UV_CONFIG_FILE=pyproject.toml uv pip show ruff where pyproject.toml contains

[tool.uv.pip.index-url]
Url="https://randomstring/simple"

uv version: 0.1.38

Am I doing something wrong or is this still not ready for use?

charliermarsh commented 2 weeks ago

I think you would want:

[tool.uv.pip]
index-url = "https://randomstring/simple"
florianfischer91 commented 2 weeks ago

I have already tried that but i also results in an error:

error: Failed to parse `pyproject.toml`
  Caused by: TOML parse error at line 2, column 13
  |
2 | index-url = "https://randomstring/simple"
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unknown variant `https://randomstring/simple`, expected one of `Pypi`, `Url`, `Path`
charliermarsh commented 2 weeks ago

Oh sorry, thanks, I'll fix that.

charliermarsh commented 2 weeks ago

(This isn't an officially supported feature yet, it's undocumented.)

charliermarsh commented 2 weeks ago

Please continue to file bugs on it though, much appreciated!

charliermarsh commented 2 weeks ago

Fixed in https://github.com/astral-sh/uv/pull/3289.