-
-
Notifications
You must be signed in to change notification settings - Fork 628
Closed
Labels
bugSomething is not workingSomething is not workingresolverRelated to dependency resolverRelated to dependency resolver
Description
Summary
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
, andc.in
). I usedrequests
.
$ cat a.in
requests
$ cat b.in
requests
$ cat c.in
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
lpulley, jzlotek, cj81499 and ZachOldham
Metadata
Metadata
Assignees
Labels
bugSomething is not workingSomething is not workingresolverRelated to dependency resolverRelated to dependency resolver