-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Unsafe requirements are no longer included in the requirements.txt generated by pip-compile #1786
Comments
If you don't mind sending a PR with a failing test, it'd be highly appreciated. |
requirements.in
requirements.txt
|
I noticed that in previous versions of pip-tools (e.g. 6.6.2) the output would contain "unsafe packages" message at the end:
What happened in a larger Python project we have at work, is that after upgrading pip-tools, the unsafe message at the bottom disappeared and @VagueAndroid could it be that instead of not listing the package at all, it was still included but got moved elsewhere in the output? |
@georgipopovhs could you share your minimal reproducer? |
requirements.in
Old version & format:
requirements.txt
New version & format:
requirements.txt
|
Proposed change fails in |
@georgipopovhs No, that's a regression. |
This test is wrong, is not it? pip-tools/tests/test_cli_compile.py Lines 1497 to 1507 in 59816bd
Considering UNSAFE_PACKAGES={"small-fake-with-deps"} it should be
And why was it patching UNSAFE_PACKAGES only in resolver.py and not in writer.py too monkeypatch.setattr("piptools.resolver.UNSAFE_PACKAGES", {"small-fake-with-deps"}) |
@q0w that was an oversight I guess. |
After v6.12.0 the unsafe packages pip and setuptools are no longer included in the requirements.txt when --allow-unsafe is used in pip-compile.
There was a change made in writer.py (#1766)
I think this line should be using unsafe_packages if the user has specified allow_unsafe rather than if they have not:
unsafe_packages = unsafe_packages if not self.allow_unsafe else set()
I think this should be:
unsafe_packages = unsafe_packages if self.allow_unsafe else set()
Environment Versions
Steps to replicate
Ensure requirements.in file includes pip and then run:
pip-compile --verbose --allow-unsafe --output-file requirements.txt requirements.in
Expected result
requirements.txt should end with this:
The following packages are considered to be unsafe in a requirements file:
pip==22.3.1
# via -r requirements.in
Actual result
The unsafe packages are not listed in the requirements.txt at all
The text was updated successfully, but these errors were encountered: