-
Notifications
You must be signed in to change notification settings - Fork 797
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
Fail to read metadata from .dist-info
: data did not match any variant of untagged enum DirectUrl
#1744
Comments
I've checked https://packaging.python.org/en/latest/specifications/direct-url-data-structure/ and PEP 610 neither defines what grammar the url field allows :/ What command did you use to install qPython? |
It was installed by Poetry, I'm playing around with |
I can look at this (though mildly dreading it). |
I'd expect the poetry maintainers would be willing to fix this, i wonder if any other tools are doing something similar. It would be helpful if we could agree in https://packaging.python.org/en/latest/specifications/direct-url-data-structure/ that |
Looks like an oversight in the spec, but that was the intent, yes. |
Happy to report that |
Seems like poetry is just writing out the source url specified in I had something like [tool.poetry.dependencies]
qpython = { git = "git@github.example.com:example/qPython.git", rev = "7190a34911a789bd8e44f6b1986c8e84815b62e2" } in |
We should at least handle this gracefully though, I think... |
## Summary Allows the corresponding `pypi_types` struct to use any URL, since other installers can put those into the environment, and Poetry seems to write invalid URLs. If we see a distribution with an invalid URL, we just treat it as a registry distribution, which isn't ideal, but is better than (1) erroring, and (2) changing `Url` to `String` everywhere internally. (I'm torn on this second option.) Closes #1744. ## Test Plan - Added `flask = { git = "git@github.com:pallets/flask.git", rev = "b90a4f1f4a370e92054b9cc9db0efcb864f87ebe" }` to `scripts/editable-installs/poetry_editable/pyproject.toml`. - Ran `poetry install`. - Ran `cargo pip freeze`. Verified that it errored on `main`, but passed here. - Ran `cargo run pip install "flask==3.0.0"`. Verified that it uninstalled the existing Flask, and installed a new version from the registry.
$ uv pip freeze error: Failed to read metadata: from /home/ubuntu/workspace/example/.venv/lib/python3.10/site-packages/qPython-2.0.0.dist-info Caused by: data did not match any variant of untagged enum DirectUrl
uv/crates/pypi-types/src/direct_url.rs
Lines 32 to 37 in d05cb84
Probably because the
url
crate can't parsegit@github.example.com:example/qPython.git
: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3a089088700e500364057509872b61f9uv version: 0.1.5
The text was updated successfully, but these errors were encountered: