You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pip-compile drops annotations when using --resolver=backtracking. Source requirements.in files are missing under the relevant via section. Which source file is missing is dependent on the order of the arguments.
Running the below tests with more files, it appears that only the first and last files are included in the annotations.
Environment Versions
OS Type: Linux 4.15.0-182-generic Ubuntu x86_64 GNU/Linux
Python version: $ python -V: Python 3.8.16
pip version: $ pip --version: pip 22.0.3 from python 3.8
pip-tools version: $ pip-compile --version: pip-compile, version 6.10.0
Steps to replicate
Create 3 requirements.in files with the same single requirement (a.in, b.in, and c.in). I used requests.
Run pip-compile --resolver=legacy --output-file=legacy-requirements.txt a.in b.in c.in to generate the expected result
Run pip-compile --resolver=backtracking --output-file=backtracking-requirements.txt a.in b.in c.in to generate the first actual result
Run pip-compile --resolver=backtracking --output-file=backtracking-reorder-requirements.txt a.in c.in b.in to generate the second actual result
Expected result
Generated by Step 2, specifically the via section of requests. I expect that the annotations section would always contain every source for the relevant requirement.
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=legacy-requirements.txt a.in b.in c.in
#
certifi==2022.12.7
# via requests
charset-normalizer==3.1.0
# via requests
idna==3.4
# via requests
requests==2.28.2
# via
# -r a.in
# -r b.in
# -r c.in
urllib3==1.26.15
# via requests
First Actual result
Generated by Step 3, note b.in is missing from the via section of requests
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=backtracking-requirements.txt --resolver=backtracking a.in b.in c.in
#
certifi==2022.12.7
# via requests
charset-normalizer==3.1.0
# via requests
idna==3.4
# via requests
requests==2.28.2
# via
# -r a.in
# -r c.in
urllib3==1.26.15
# via requests
Second Actual Result
Generated by Step 4, note now c.in is missing from the via section of requests
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=backtracking-reorder-requirements.txt --resolver=backtracking a.in b.in c.in
#
certifi==2022.12.7
# via requests
charset-normalizer==3.1.0
# via requests
idna==3.4
# via requests
requests==2.29.0
# via
# -r a.in
# -r b.in
urllib3==1.26.15
# via requests
The text was updated successfully, but these errors were encountered:
Has the cause of this been determined? I've seen many a malformed lockfile entry due to this, and it seems like something that wouldn't require much new code, but I'm not familiar enough with this project to say for certain. I could be entirely misjudging it.
In any case, this seems like it should affect lots of users, so I'm surprised to see so little conversation here. If this becomes enough of a problem, I might try to learn how all this works and try to fix it myself, but I'm hopeful that someone is already working on this quietly?
Summary
pip-compile drops annotations when using
--resolver=backtracking
. Sourcerequirements.in
files are missing under the relevantvia
section. Which source file is missing is dependent on the order of the arguments.Running the below tests with more files, it appears that only the first and last files are included in the annotations.
Environment Versions
$ python -V
: Python 3.8.16$ pip --version
: pip 22.0.3 from python 3.8$ pip-compile --version
: pip-compile, version 6.10.0Steps to replicate
a.in
,b.in
, andc.in
). I usedrequests
.pip-compile --resolver=legacy --output-file=legacy-requirements.txt a.in b.in c.in
to generate the expected resultpip-compile --resolver=backtracking --output-file=backtracking-requirements.txt a.in b.in c.in
to generate the first actual resultpip-compile --resolver=backtracking --output-file=backtracking-reorder-requirements.txt a.in c.in b.in
to generate the second actual resultExpected result
Generated by Step 2, specifically the via section of requests. I expect that the annotations section would always contain every source for the relevant requirement.
First Actual result
Generated by Step 3, note
b.in
is missing from the via section of requestsSecond Actual Result
Generated by Step 4, note now
c.in
is missing from the via section of requestsThe text was updated successfully, but these errors were encountered: