Description
While working on the new resolver support in pip-tools (jazzband/pip-tools#1539) I ran into an issue with failing tests against pip's main branch. Using git bisect I've tracked down a bad commit 0c28452 which was introduced in #10962.
The main issue with the following line:
|
template.req.specifier = specifier |
... where template essentially is ireqs[0]:
See also discussion on the commit.
Expected behavior
I've prepared a temporary fix where template is deep copied from ireqs[0] (see #11018) which makes pip-tools' tests pass. Any ideas on how to avoid ireqs mutation which might lead to potential bugs?
pip version
22.1.dev0
Python version
3.8
OS
macOS
How to Reproduce
Unfortunately, I haven't found yet simple reproducer other than pip-tools' tests:
git clone https://github.com/atugushev/pip-tools@new-resolver
cd pip-tools
tox -e py38-pipmain -- -k 'not network'
Output
https://github.com/jazzband/pip-tools/runs/5872141303?check_suite_focus=true
Code of Conduct
Description
While working on the new resolver support in pip-tools (jazzband/pip-tools#1539) I ran into an issue with failing tests against pip's main branch. Using
git bisectI've tracked down a bad commit 0c28452 which was introduced in #10962.The main issue with the following line:
pip/src/pip/_internal/resolution/resolvelib/factory.py
Line 310 in 0c28452
... where
templateessentially isireqs[0]:pip/src/pip/_internal/resolution/resolvelib/factory.py
Line 258 in 0c28452
See also discussion on the commit.
Expected behavior
I've prepared a temporary fix where
templateis deep copied fromireqs[0](see #11018) which makes pip-tools' tests pass. Any ideas on how to avoidireqsmutation which might lead to potential bugs?pip version
22.1.dev0
Python version
3.8
OS
macOS
How to Reproduce
Unfortunately, I haven't found yet simple reproducer other than pip-tools' tests:
git clone https://github.com/atugushev/pip-tools@new-resolvercd pip-toolstox -e py38-pipmain -- -k 'not network'Output
https://github.com/jazzband/pip-tools/runs/5872141303?check_suite_focus=true
Code of Conduct