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

Avoid enforcing URL correctness for installed distributions #1793

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

charliermarsh
Copy link
Member

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.

@charliermarsh charliermarsh added the bug Something isn't working label Feb 21, 2024
@konstin
Copy link
Member

konstin commented Feb 21, 2024

I'm trying to get this fixed upstream: pypa/packaging.python.org#1506

@charliermarsh
Copy link
Member Author

@konstin - I think we should still merge this? It means uv is otherwise unusable (even to list installed dependencies) in certain Poetry environments.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to until there's a poetry release with the fix

@charliermarsh charliermarsh merged commit a2a1b2f into main Feb 21, 2024
7 checks passed
@charliermarsh charliermarsh deleted the charlie/direct branch February 21, 2024 14:06
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 this pull request may close these issues.

Fail to read metadata from .dist-info: data did not match any variant of untagged enum DirectUrl
2 participants