Skip to content

Misleading error message when using constraints file #17960

@Czaki

Description

@Czaki

Summary

In the napari project, we are using tox with tox-uv and tox-min-req plugins. The second one is my project.

This plugin is reading pyproject.toml and generating a constraints file with pinning versions of direct constraints to the lowest defined.

So for numpy>=1.24.2 it will add to the constraints file, the numpy==1.24.2 entry, and for "pywin32 ; platform_system == 'Windows'" will not add entry.

In the PR napari/napari#8646 the team member bumped the version of one of our dependencies (superqt). But at this state our dependencies contain qtpy>=2.3.1 and superqt one contains qtpy>=2.4.0. So generate a constraints file containing qtpy==2.3.1 that creates an environment impossible to resolve.

However, the error message, instead of mentioning the constraints file, points to the napari-plugin-manager as the source of conflict.

Using Python 3.10.19 environment at: .tox/py310-linux-pyqt5-cov
  × No solution found when resolving dependencies:
  ╰─▶ Because superqt==0.7.8 depends on qtpy>=2.4.0 and
      napari-plugin-manager==0.1.10 depends on superqt==0.7.8, we can conclude
      that napari-plugin-manager==0.1.10 depends on qtpy>=2.4.0.
      And because napari-plugin-manager==0.1.10 depends on qtpy==2.3.1, we can
      conclude that napari-plugin-manager==0.1.10 cannot be used.
      And because only napari-plugin-manager<=0.1.10 is available and you
      require napari-plugin-manager>=0.1.10, we can conclude that your
      requirements are unsatisfiable.

The napari-plugin-manager do not provide any constraints on qtpy version:

https://github.com/napari/napari-plugin-manager/blob/cad2c38d06d6a282c5601e4d557735b37a2b13c7/pyproject.toml#L55

It will be really nice to point out that problematic constraints are coming from the constraints file (provided by the UV_CONSTRAINTS environment variable), not put a random package in its place.

Full log of CI run: https://github.com/napari/napari/actions/runs/21787550870/job/62864041807?pr=8646

napari pinning of qtpy: https://github.com/napari/napari/blob/b9011a81f9d1df1d96fc81b252203b542075570c/pyproject.toml#L67

superqt pinning of qtpy: https://github.com/pyapp-kit/superqt/blob/872dff13eb03818d92dd610dbda28bb631600a9c/pyproject.toml#L49

Platform

GHA ubuntu-22.04

Version

0.10.2

Python version

3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingerror messagesMessaging when something goes wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions