-
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
[2020-resolver] Resolver fails to install editable when self in dependencies #9143
Comments
I believe this is a variant to |
I just spoke about this issue with @pradyunsg. This regression is not strictly a duplicate of other issues, but is probably being solved or partially addressed by pull requests subsequent to Jason opening the issue. It's a tricky problem! The user is installing a package. Within the dependency graph, they see the same package. But since pip is doing an editable install of a local directory, the resolver doesn't realize it's the same package, and does the wrong things. This may be difficult to fix -- that's a little unknown right now -- and we probably have not gotten enough testing of editable environments, during the beta, compared to testing other setups/use cases. We can also assume that approximately everyone dealing with this problem will be a Python developer (with a little more level of skill, at least, than our less-expert users). Since the 20.3 release #8936 is so delayed compared to our plans, I have made the call to defer this particular issue to post-release work. In the meantime, until we fix this (maybe in a point release between now and 21.0), the user may want to use |
Thanks for the update and the diligent work. No worries on the delay. I recognize that it's a difficult problem. Since there's an escape hatch, that's probably acceptable. Thanks for everything. |
This is affecting us also. Thanks for the workaround. |
Merging the conversation with #8785 to avoid messages from scattering. |
I encountered this issue again in python/importlib_metadata#273. In this case, |
Jason R. Coombs (18): Use inline flags with local scope. Honor TOX_WORK_DIR if set. Workaround for tox-dev/tox#20. Collapse skeleton history from archive/2020-12 Update skeleton description to describe the periodic collapse. Fixes #27. Enable automerge Automatically inject project name in docs heading. pre-commit autoupdate Rename 'Automated Tests' to simply 'tests' Add note about automatic merging of PRs and the requirements and limitations. Prefer pytest-enabler to jaraco.test Enable complexity limit. Fixes jaraco/skeleton#34. Add support for namespace packages. Closes jaraco/skeleton#40. Disable 2020-resolver. Workaround for pypa/pip#9143. Normalize indentation Exclude dist from discovered packages. Fixes jaraco/skeleton#46. It's no longer necessary to filter this warning and it's not a warning anymore. Bump minimum pytest Update changelog. KOLANICH (1): Added an .editorconfig. Pull request jaraco/skeleton#43. Sviatoslav Sydorenko (3): Replace pep517.build with build (#37) Use license_files instead of license_file in meta (#35) Use `extend-ignore` in flake8 config (#33)
In sphinx-doc/sphinx#9825 and tox-dev/tox#2272, I found that the workaround for this issue (pinning to legacy resolver) was causing other problems (legacy resolver was installing conflicting requirements). In jaraco/pytest-checkdocs@ba62865, I attempted to restore the 2020 resolver, but now the tests fail with this error:
Somehow it seems that the package is being assigned a version of 0.1.dev1 even though the version in metadata is 2.7.2.dev:
Is this bug still a duplicate of #8785? |
Interestingly, I don't encounter the issue when I test locally (macOS), so maybe there's something about the GHA environment that has an older virtualenv/pip that doesn't include the fix. I see the failed tests get the latest virtualenv (20.10.0), so that's likely not the issue. |
Okay. I see GHA checks out the repo with |
It looks like in jaraco/pytest-checkdocs#16, I have a working fix. Thanks for fixing the issue in pip! |
In jaraco/pytest-checkdocs#6, I discovered an apparent regression with the resolver. With the old resolver, installing a package in editable mode would satisfy dependencies. Wtih the new resolver, a separate installation
pytest-checkdocs==2.1.1
gets installed even thoughpytest-checkdocs-2.1.2dev17+g3df4d42
would be installed (the local checkout).Why would you declare a dependency on self? The declared dependency is part of a package template used across hundreds of packages. It would be possible to customize that (test) dependency (omit it) just for this package, and doing so does work around the issue, but it should also be the case that if
.
satisfies one of the dependencies, that dependency shouldn't be downloaded/installed, or at the very least, the editable copy should supersede the downloaded version.Since this behavior worked as I would expect prior to the 2020-resolver, it would be nice to restore that behavior.
The text was updated successfully, but these errors were encountered: