uv
uv copied to clipboard
Failed to parse `example @ example.whl; sys_platform == 'win32'`
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.
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'
I believe there's some syntactic ambiguity here (or are parsing logic is slightly wrong). Will look into it.
Related to https://github.com/astral-sh/uv/issues/1110.
\cc @konstin for when you're back.
Thank you for the quick reply! I can confirm that putting a space in front of the ; makes it work.
I think we can require the space, but we should have a better error message for this.