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

Add support for .tar.bz2 source distributions #3069

Merged
merged 2 commits into from Apr 16, 2024

Conversation

sergeykolosov
Copy link
Contributor

Summary

Source distributions in the .tar.bz2 format are still relatively common within the existing code-bases, namely, the most common examples are the Twisted source distributions up to the version 20.3.0. As quite so often the ability to upgrade Twisted to a more recent version is not available for a given project, we add the support for .tar.bz2 here to still allow uv to be a drop-in replacement for pip in these projects.

Test Plan

The feature was tested both by adding the corresponding test coverage, and by directly installing a package of interest under a Python version that doesn't have the corresponding wheel:

cargo run venv -p python3.8
cargo run pip install Twisted==20.3.0 --no-cache

The --no-cache argument in the example above serves the purpose of cleaning the cached information regarding the unsatisfiability of the requirements, as it may have been cached during some previous attempt to install this package by uv version that didn't implement this feature yet.

Source distributions in the .tar.bz2 format are still relatively common
within the existing code-bases, namely, the most common examples are the
Twisted source distributions up to the version 20.3.0. As quite so often
the ability to upgrade Twisted to a more recent version is not available
for a given project, we add the support for .tar.bz2 here to still allow
`uv` to be a drop-in replacement for `pip` in these projects.
@sergeykolosov sergeykolosov changed the title Added support for .tar.bz2 source distributions Add support for .tar.bz2 source distributions Apr 16, 2024
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks, this looks reasonable to me.

// for the given version of Python).
uv_snapshot!(context.install()
.arg("Twisted==20.3.0")
.arg("--strict"), @r###"
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to use --no-binary twisted, just to be sure that we aren't using the wheel? Also, can you make this a pip sync test instead to avoid the extra work downloading those other packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, working on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the changes.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

This lets us avoid the extra work downloading numerous packages Twisted
depends on. Also, added `--no-binary :all:` to ensure excluding wheels.
@charliermarsh charliermarsh enabled auto-merge (squash) April 16, 2024 18:30
@charliermarsh charliermarsh merged commit d2551bb into astral-sh:main Apr 16, 2024
38 checks passed
@sergeykolosov sergeykolosov deleted the archive-type-bz2 branch April 27, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants