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

Running pip-compile with a dev-requirements.in that adds an extra to a library has inconsistent output #1478

Closed
arthurio opened this issue Aug 30, 2021 · 4 comments

Comments

@arthurio
Copy link

When you define a requirements.in file that has a library with no [extra] and use the requirement.txt output as input for a dev-requirements.in file that adds an [extra], the output dev-requirements.txt will inconsistently have either the [extra] at the end of the library or not...

Environment Versions

  1. MacOS 11.5.2 (but also happens on linux)
  2. Python version: 3.7.11, 3.8.7, 3.9.1
  3. pip version: 21.2.4
  4. pip-tools version: 6.2.0

Steps to replicate

I have created a reproducible demo:

  1. Minimal library repo: https://github.com/arthurio/pip-tools-bug-lib
  2. Bug repro repo: https://github.com/arthurio/pip-tools-bug-extra-repro

In the bug repro repo, I have a script called pip-compile.sh. If you remove the .txt files and run the script twice, you'll see that the first time dev-requirements.txt contains git+https://git@github.com/arthurio/pip-tools-bug-lib#egg=my-lib[test]
but the second time it contains git+https://git@github.com/arthurio/pip-tools-bug-lib#egg=my-lib.

You can see that from the 2 consecutive commits:

  1. arthurio/pip-tools-bug-extra-repro@63cefce#diff-43470c4f399e798afc682f0bf6c690eef5f47ee25445904a066e4c3314f3a787R11
  2. arthurio/pip-tools-bug-extra-repro@33f8d6f#diff-43470c4f399e798afc682f0bf6c690eef5f47ee25445904a066e4c3314f3a787R11

Expected result

I would expect pip-compile to always keep the [extra] flag.

Actual result

pip-compile strips out the [extra] flag the second time it's ran.

@arthurio arthurio changed the title Running pip-compile on dev-requirements.in that adds an extra to a library has inconsistent output Running pip-compile in dev-requirements.in that adds an extra to a library has inconsistent output Aug 30, 2021
@arthurio arthurio changed the title Running pip-compile in dev-requirements.in that adds an extra to a library has inconsistent output Running pip-compile with a dev-requirements.in that adds an extra to a library has inconsistent output Aug 30, 2021
@arthurio
Copy link
Author

Also, the same happens with just a library name (not using a git url)

@AndydeCleyre
Copy link
Contributor

This might be a dupe of #1451

@arthurio
Copy link
Author

arthurio commented Sep 1, 2021

@AndydeCleyre You are right, sorry about that!

@arthurio arthurio closed this as completed Sep 1, 2021
@AndydeCleyre
Copy link
Contributor

No worries! Thanks for the issue; your documented case helps describe the problem.

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

2 participants