Skip to content

inconsistent inclusion of constrants in conflict log reports #13545

@cburroughs

Description

@cburroughs

Description

When pip detects that a resolution is impossible and throws an error the constraints are included in the output:

msg += f"\n The user requested (constraint) {key}{spec}"

However, when pip says "Will try a different candidate, due to conflict:" the constraints are not included in the log output:

msg = "Will try a different candidate, due to conflict:"

Expected behavior

These messages are otherwise similar enough I'd expect them to include the same information.

pip version

25.2

Python version

3.11.13

OS

linux

How to Reproduce

As an example:

$ cat reqs.txt 
click
cryoet-data-portal>=4.4.1
fsspec>=2024.6.0
numpy
ome-zarr
psutil
pydantic>=2
s3fs
scikit-image
trimesh
zarr<3
numcodecs<0.16.0
distinctipy
tqdm
textual
mrcfile
$ cat con.txt 
fsspec<=2026
s3fs<=2026

Then running pip download -r reqs.txt -c con.txt --prefer-binary --log pip-download.log will produce log output along the lines of:

2025-08-13T15:53:57,464 Will try a different candidate, due to conflict:
2025-08-13T15:53:57,464     The user requested fsspec>=2024.6.0
2025-08-13T15:53:57,464     ome-zarr 0.11.1 depends on fsspec!=2021.07.0, !=2023.9.0 and >=0.8
2025-08-13T15:53:57,464     s3fs 2025.3.1 depends on fsspec==2025.3.1.*

Which omits the fsspec<=2026 user supplied constraint.

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: needs triageIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions