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 pip-compile's --unsafe-package flag #1889

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Feb 23, 2024

Summary

In uv, we're going to use --no-emit-package for this, to convey that the package will be included in the resolution but not in the output file. It also mirrors flags like --emit-index-url.

We're also including an --unsafe-package alias.

Closes #1415.

@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality compatibility Compatibility with a specification or another tool labels Feb 23, 2024
@charliermarsh
Copy link
Member Author

I'm torn on the name --unsafe-package, and the use of "unsafe" in the footer comment (which matches pip-compile), like:

# The following packages are considered to be unsafe in a requirements file:
# jinja2

@hauntsaninja
Copy link
Contributor

Yeah :-/ It's unfortunate that pip-compile puts those words in the file. I do think it'd be nice to have an --exclude-package alias.

@charliermarsh charliermarsh enabled auto-merge (squash) February 23, 2024 18:45
@charliermarsh charliermarsh merged commit eaf613e into main Feb 23, 2024
7 checks passed
@charliermarsh charliermarsh deleted the charlie/unsafe-package branch February 23, 2024 18:47
writeln!(
writer,
"{}",
"# The following packages were included while generating the resolution:".green()
Copy link
Contributor

@hauntsaninja hauntsaninja Feb 23, 2024

Choose a reason for hiding this comment

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

Thank you for implementing the feature!

nit: I was confused by "include" here, maybe The following packages were omitted from the result: (although maybe omit vs no-emit confuses folks too, so maybe just "excluded")

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea -- changed in #1935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support --unsafe-package in uv pip compile
2 participants