Skip to content

Buggy interplay between --python, --python-version and dependency with Python upper bound in pip compile #6859

@BarrensZeppelin

Description

@BarrensZeppelin

I use uv@0.4.0 to pip compile the dependency specifier scipy==1.9.0.
scipy==1.9.0 has a Python version requirement of >=3.8,<3.12.

The command I'm running is
echo "scipy==1.9.0" | uv pip compile --python X.Y --python-version X.Y [--universal] -

When the command fails, the error message is always:

  × No solution found when resolving dependencies:
  ╰─▶ Because the current Python version (3.12.5) does not satisfy Python>=3.8,<3.12 and scipy==1.9.0 depends on Python>=3.8,<3.12, we can
      conclude that scipy==1.9.0 cannot be used.
      And because you require scipy==1.9.0, we can conclude that your requirements are unsatisfiable.

I've compiled a table of results with different combinations of --python and --python-version arguments + --universal mode.

--python --python-version --universal Success Expected
3.12 3.12 X X
3.12 3.11 X X X
3.12 3.10 X
3.11 3.12 X X
3.11 3.11 X
3.12 3.12 X
3.12 3.11 X X
3.12 3.10
3.11 3.12 ?
3.11 3.11

There are two failures that definitely look unexpected to me.
I'm not certain whether --python 3.11 --python-version 3.12 --universal is expected to succeed.
Also, I had the impression that python version upper bounds were ignored (in --universal mode?), so maybe some of the cases I marked as expected failures are actually unexpected.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions