Skip to content

Potential bug on install requirements mutation during dependency resolution #11019

Open
@atugushev

Description

@atugushev

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:

  1. git clone https://github.com/atugushev/pip-tools@new-resolver
  2. cd pip-tools
  3. tox -e py38-pipmain -- -k 'not network'

Output

https://github.com/jazzband/pip-tools/runs/5872141303?check_suite_focus=true

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions