Skip to content

Commit 23d874e

Browse files
authored
Fix a regression with unsafe packages for --allow-unsafe (#1788)
1 parent 59816bd commit 23d874e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

piptools/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _iter_lines(
181181
hashes: dict[InstallRequirement, set[str]] | None = None,
182182
) -> Iterator[str]:
183183
# default values
184-
unsafe_packages = unsafe_packages if not self.allow_unsafe else set()
184+
unsafe_packages = unsafe_packages if self.allow_unsafe else set()
185185
hashes = hashes or {}
186186

187187
# Check for unhashed or unpinned packages if at least one package does have

tests/test_cli_compile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,8 @@ def test_annotate_option(pip_conf, runner, options, expected):
15001500
"""\
15011501
small-fake-a==0.1
15021502
small-fake-b==0.3
1503+
1504+
# The following packages are considered to be unsafe in a requirements file:
15031505
small-fake-with-deps==0.1
15041506
"""
15051507
),

0 commit comments

Comments
 (0)