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

Fix adds a fixed dependency in files where there is no original one #633

Open
q0w opened this issue Jun 12, 2023 · 2 comments
Open

Fix adds a fixed dependency in files where there is no original one #633

q0w opened this issue Jun 12, 2023 · 2 comments
Labels
bug Something isn't working component:dep-sources Dependency sources

Comments

@q0w
Copy link

q0w commented Jun 12, 2023

Bug description

Fix (--fix) adds a fixed dependency in files where there is no original one.

Reproduction steps

echo httpx==0.13.3 > a.in
echo astpretty > b.in
pip-compile a.in --allow-unsafe --generate-hashes --resolver=backtracking
pip-compile b.in --allow-unsafe --generate-hashes --resolver=backtracking
pip-audit -r a.txt -r b.txt --fix --no-deps

b.txt output before

#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes --resolver=backtracking b.in
#
astpretty==3.0.0 \
    --hash=sha256:15bfd47593667169485a1fa7938b8de9445b11057d6f2b6e214b2f70667f94b6 \
    --hash=sha256:b08c95f32e5994454ea99882ff3c4a0afc8254c38998a0ed4b479dba448dc581
    # via -r b.in

b.txt output now

#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes --resolver=backtracking b.in
#
astpretty==3.0.0 \
    --hash=sha256:15bfd47593667169485a1fa7938b8de9445b11057d6f2b6e214b2f70667f94b6 \
    --hash=sha256:b08c95f32e5994454ea99882ff3c4a0afc8254c38998a0ed4b479dba448dc581
# via -r b.in
    # pip-audit: subdependency explicitly fixed
httpx==0.23.0

Expected behavior

Fixed httpx version should not be added in b.txt, only in a.txt where it was originally

Screenshots and logs

Platform information

  • OS name and version: Arch Linux
  • pip-audit version (pip-audit -V): pip-audit 2.5.6
  • Python version (python -V or python3 -V): Python 3.11.3
  • pip version (pip -V or pip3 -V): pip 23.1.2

Additional context

Add any other context about the problem here.

@q0w q0w added the bug-candidate Might be a bug. label Jun 12, 2023
@woodruffw
Copy link
Member

woodruffw commented Jun 12, 2023

Thanks for the report!

If I'm understanding correctly: the problem here is that we're "fixing" the subdependency in both files, when it should really only be fixed in one, right?

@woodruffw woodruffw added the component:dep-sources Dependency sources label Jun 12, 2023
@q0w
Copy link
Author

q0w commented Jun 12, 2023

Yes

@woodruffw woodruffw added bug Something isn't working and removed bug-candidate Might be a bug. labels Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:dep-sources Dependency sources
Projects
None yet
Development

No branches or pull requests

2 participants