Skip to content

Commit

Permalink
Fix a regression with unsafe packages for --allow-unsafe (jazzband#1788)
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Dec 24, 2022
1 parent 59816bd commit 23d874e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion piptools/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _iter_lines(
hashes: dict[InstallRequirement, set[str]] | None = None,
) -> Iterator[str]:
# default values
unsafe_packages = unsafe_packages if not self.allow_unsafe else set()
unsafe_packages = unsafe_packages if self.allow_unsafe else set()
hashes = hashes or {}

# Check for unhashed or unpinned packages if at least one package does have
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,8 @@ def test_annotate_option(pip_conf, runner, options, expected):
"""\
small-fake-a==0.1
small-fake-b==0.3
# The following packages are considered to be unsafe in a requirements file:
small-fake-with-deps==0.1
"""
),
Expand Down

0 comments on commit 23d874e

Please sign in to comment.