uv icon indicating copy to clipboard operation
uv copied to clipboard

Failed to parse `example @ example.whl; sys_platform == 'win32'`

Open jan11011977 opened this issue 1 year ago • 5 comments

I have a requirements file with a line that tries to install a local .whl file, but only on Windows. When I try to run this, UV gives an error:

error: Failed to parse `python_ldap @ wheels/python_ldap-3.4.0-cp311-cp311-win_amd64.whl;   sys_platform == 'win32'`
  Caused by: Expected end of input or ';', found 's'
python_ldap @ wheels/python_ldap-3.4.0-cp311-cp311-win_amd64.whl;   sys_platform == 'win32'
                                                                    ^

If I remove the sys_platform part it works. sys_platform does also work if I'm not installing a local package, but I haven't been able to combine the local package syntax with the sys_platform filter.

This was on Windows, UV version 0.1.4. Apologies if I'm doing something wrong here, but I couldn't figure it out.

jan11011977 avatar Feb 18 '24 10:02 jan11011977

I need to look into the spec, but it does work if you separate with a space, like:

python_ldap @ wheels/python_ldap-3.4.0-cp311-cp311-win_amd64.whl ; sys_platform == 'win32'

charliermarsh avatar Feb 18 '24 15:02 charliermarsh

I believe there's some syntactic ambiguity here (or are parsing logic is slightly wrong). Will look into it.

charliermarsh avatar Feb 18 '24 15:02 charliermarsh

Related to https://github.com/astral-sh/uv/issues/1110.

charliermarsh avatar Feb 18 '24 15:02 charliermarsh

\cc @konstin for when you're back.

charliermarsh avatar Feb 18 '24 15:02 charliermarsh

Thank you for the quick reply! I can confirm that putting a space in front of the ; makes it work.

jan11011977 avatar Feb 18 '24 15:02 jan11011977

I think we can require the space, but we should have a better error message for this.

charliermarsh avatar Feb 20 '24 02:02 charliermarsh