Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse version with 'comma', >=3.6, at end #1361

Closed
onjin opened this issue Feb 15, 2024 · 5 comments · Fixed by #1409
Closed

Failed to parse version with 'comma', >=3.6, at end #1361

onjin opened this issue Feb 15, 2024 · 5 comments · Fixed by #1409
Assignees
Labels
bug Something isn't working

Comments

@onjin
Copy link

onjin commented Feb 15, 2024

https://pypi.org/simple/openpyxl/?format=application/vnd.pypi.simple.v1+json

uv pip install openpyxl==3.0.5
error: Failed to download: openpyxl==3.0.5
  Caused by: Couldn't parse metadata of openpyxl-3.0.5-py2.py3-none-any.whl from https://files.pythonhosted.org/packages/5c/90/61f83be1c335a9b69fa773784a785d9de95c7561d1661918796fd1cba3d2/openpyxl-3.0.5-py2.py3-none-any.whl
  Caused by: Failed to parse version: Unexpected end of version specifier, expected operator:
>=3.6, 
uv --version
uv 0.1.0
@zanieb zanieb added the bug Something isn't working label Feb 15, 2024
@zanieb
Copy link
Member

zanieb commented Feb 15, 2024

Thanks for the report! We'll add this to our mistake-tolerant parser.

@zanieb zanieb self-assigned this Feb 15, 2024
@onjin onjin changed the title Failed to parse version with 'coma', >=3.6, at end Failed to parse version with 'comma', >=3.6, at end Feb 15, 2024
@zanieb
Copy link
Member

zanieb commented Feb 15, 2024

Interesting we have support for this

#[test]
fn requirement_trailing_comma() {
let actual: Requirement = LenientRequirement::from_str("pyzmq >=3.6,").unwrap().into();
let expected: Requirement = Requirement::from_str("pyzmq >=3.6").unwrap();
assert_eq!(actual, expected);
}

We'll need to see why it's not being used

@onjin
Copy link
Author

onjin commented Feb 15, 2024

It comes from "requires-python": ">=3.6,", entry

@zanieb
Copy link
Member

zanieb commented Feb 15, 2024

Thanks we might treat those differently!

@charliermarsh
Copy link
Member

I can take this one real quick.

charliermarsh added a commit that referenced this issue Feb 16, 2024
## Summary

Closes #1361.

## Test Plan

```text
Resolved 3 packages in 243ms
Downloaded 3 packages in 193ms
Installed 3 packages in 6ms
 + et-xmlfile==1.1.0
 + jdcal==1.4.1
 + openpyxl==3.0.5
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants