Skip to content

Comments

Avoid enforcing URL correctness for installed distributions#1793

Merged
charliermarsh merged 1 commit intomainfrom
charlie/direct
Feb 21, 2024
Merged

Avoid enforcing URL correctness for installed distributions#1793
charliermarsh merged 1 commit intomainfrom
charlie/direct

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 = "[email protected]: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
@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