astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
19.93k stars 591 forks source link

Broken path parsing for install spec #6032

Open flying-sheep opened 1 month ago

flying-sheep commented 1 month ago
$ uv --version
uv 0.2.35
$ uv pip install --editable '/home/phil/Dev/Python/Packaging, Docs/session-info2'
error: Failed to parse: `/home/phil/Dev/Python/Packaging, Docs/session-info2`
  Caused by: Expected path (`/home/phil/Dev/Python/Packaging,`) to end in a supported file extension: `.whl`, `.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`
/home/phil/Dev/Python/Packaging, Docs/session-info2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zanieb commented 1 month ago

Thanks!

cc @charliermarsh might a regression from #5888

charliermarsh commented 1 month ago

I can take a look.

flying-sheep commented 1 month ago

Ah, sorry, I should have said that there is also an error with older versions before that PR (e.g. 0.2.32)

The underlying issue of something splitting the path at the space is older.

charliermarsh commented 1 month ago

I think we currently require that you use a backslash here.

charliermarsh commented 1 month ago

(But of course it should work as-is.)

flying-sheep commented 1 month ago

I wasn’t aware that escape sequences in dependency specs are a thing at all!

charliermarsh commented 1 month ago

Yeah it's a bit tricky. Like this doesn't work:

-e /Users/crmarsh/workspace/uv/foo bar/black_editable

But it does work if you quote it, or pass it directly on the command-line etc.

flying-sheep commented 1 month ago

I am quoting it, see initial comment.

charliermarsh commented 1 month ago

Yeah I'm describing what the behavior should be, not what we do today.

flying-sheep commented 1 month ago

I see! Thank you for clarifying!