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

pip-compile incorrectly indicates packages were not pinned #2160

Open
BenjaminPelletier opened this issue Jan 29, 2025 · 0 comments
Open

pip-compile incorrectly indicates packages were not pinned #2160

BenjaminPelletier opened this issue Jan 29, 2025 · 0 comments

Comments

@BenjaminPelletier
Copy link

Pinning setuptools causes a warning indicating that setuptools was not pinned.

Environment Versions

  1. OS Type Linux
  2. Python version: $ python -V 3.11.9
  3. pip version: $ pip --version 25.0
  4. pip-tools version: $ pip-compile --version 7.4.1

Steps to replicate

  1. Create requirements.in with the following content:
flask==3.1.0
  1. Attempt to generate requirements.txt: pip-compile --generate-hashes --output-file=requirements.txt requirements.in
  2. Observe success and no warning (as expected)
  3. Determine current working version of setuptools: pip list | grep setuptools (mine is 75.8.0)
  4. Pin setuptools in requirements.in by changing its content to:
flask==3.1.0
setuptools==75.8.0
  1. Attempt to generate requirements.txt: pip-compile --generate-hashes --output-file=requirements.txt requirements.in

Expected result

Success, or at least warnings that make sense.

Actual result

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# setuptools
The generated requirements file may be rejected by pip install. See # WARNING lines for details.

This warning is extremely surprising since the change that elicits this warning is pinning the very package that the message claims was not pinned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant