-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict between editable wheel and constraints #11718
Comments
Hmm, actually, tell a lie: this also happens currently without without either
Looking further, it seems the reason we're seeing this behavior change is because tox 3 was not respecting the
Compared with tox 4:
The important pieces being these lines:
So this is not in fact a regression but closer to a feature request. |
Duplicate of #7839 |
Constraint files are often shared across an organization. When developing a package included in such a constraint file, it is not possible to install the package with constraints since the constraint on the package prevents us installing a development version. ❯ cd my-amazing-package ❯ cat constraints.txt my-amazing-package==1.2.3 Jinja2==3.1.2 iso8601==1.1.0 msgpack==1.0.4 ❯ pip install -c constraints.txt . Processing /dev/my-amazing-package Preparing metadata (setup.py) ... done ERROR: Cannot install my-amazing-package 1.2.4.dev1 (from /dev/my-amazing-package) because these package versions have conflicting dependencies. The conflict is caused by: The user requested my-amazing-package 1.2.4.dev1 (from /dev/my-amazing-package) The user requested (constraint) my-amazing-package===1.2.4.dev1 To fix this you could try to: 1. loosen the range of package versions you've specified 2. remove package versions to allow pip attempt to solve the dependency conflict ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts Resolve this by allowing users to opt out of individual constraints to the 'install', 'wheel', and 'download' subcommands. This is rather manual but it's expected that tools like tox could automatically generate a value for this option when invoking 'pip install' command. ❯ pip install -c constraints.txt --ignore-constraint my-amazing-package . ❯ pip wheel -c constraints.txt --ignore-constraint my-amazing-package . ❯ pip download -c constraints.txt --ignore-constraint my-amazing-package . This is only added for the '2020-resolver' resolver, not the 'legacy-resolver' resolver, given the latter is deprecated for removal. Signed-off-by: Stephen Finucane <[email protected]> Fixes: pypa#11718
Description
PEP-660 describes a mechanism to support editable installs by building and installing editable wheels. This will replace the legacy
setup.py develop
path.This is behaviour that pip itself will most likely eventually default to itself (per #11457). It can be opted into today using the
--use-pep517
flag. tox 4, meanwhile, utilises thepyproject-api
project, a separate PEP-517 build frontend, and is already implementing this behaviour, which is where this issue was first spotted.Unfortunately it appears there is an issue combining editable wheels and constraints file. Where the package being installed in editable mode is also listed in a constraints file (passed to
pip install
via the-c
flag), pip's dependency resolver will raise aResolutionImpossible
error. Given this does not happen with thesetup.py develop
path, this seems to be a regression. This is already causing issues with tox 4 and when pip makes editable wheels the default, it will no longer be possible to test new versions of a given package using a single unified constraints file. This is something the OpenStack community, for one, relies on heavily.Expected behavior
The constraint for the package being installed in editable mode should be ignored, ideally by default or else via a user-configurable flag.
pip version
22.3.1
Python version
3.11.1
OS
Fedora 37
How to Reproduce
You can also achieve this using tox 4. You'll need to modify the
tox.ini
file and setinstall_command
so that tox uses this to install the package itself, rather than just the dependencies.Output
Code of Conduct
The text was updated successfully, but these errors were encountered: