-
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
Error checking if package with dotted name is installed (pip==20.2) #8645
Comments
This seems like a normalisation issue. Dot, underscore, and dash are actually treated as equivalents when comparing package names, so pip is probably not doing that comparison correctly somewhere. |
You refer to the snippet below? pip/src/pip/_vendor/packaging/utils.py Lines 16 to 23 in 31299ee
|
@damb that |
Here is a reproducer for a variant of what is probably the same bug: #!/bin/bash
set -ex
cd $(mktemp -d)
python3 -m venv venv
. venv/bin/activate
pip install -U "pip>=20.2" wheel py3o.formats
echo "from setuptools import setup; setup(name='myproject', install_requires=['py3o.formats'])" > setup.py
pip install --no-index -e . |
So the bug is in Apparently, passing a canonical name with dots replaced by dashes is not compatible with Example: $ pip install zope.inferface
$ python -c "import pkg_resources as pr; print(pr.get_distribution('zope.interface'))"
zope.interface 5.1.0
$ python -c "import pkg_resources as pr; print(pr.get_distribution('zope-interface'))"
...
pkg_resources.DistributionNotFound: The 'zope-interface' distribution was not found and is required by the application |
You beat me to it 😛 Relevent code: pip/src/pip/_vendor/pkg_resources/__init__.py Lines 1317 to 1322 in 31299ee
We’ll probably need to ask setuptools maintainers whether this is an oversight or a delibrate decision, and whether we can patch this logic ourselves. |
Or alternatively, we can rollback #8054 (the root issue it tries to resolve is exactly |
Looks like we'd need a bugfix release.
I like this plan. Anyone wanna file a PR for this? |
I wanted to verify why |
Oh, good point! IIRC that was planned as a follow-up PR (since the refactoring would be difficult to review if committed together with the |
I experiemented a bit, and it seems like switching from calling Since this is a quite significant issue (there are many popular packages preferring to be referred by a dot in the name, e.g. coverage.py), I’m going to do the one required replacement in a separate PR, so we can get a bugfix version out as soon as possible. #8114 and the other replacements can happen afterwards. |
I opened #8659 to fix |
158: Update pip to 20.2.1 r=duckinator a=pyup-bot This PR updates [pip](https://pypi.org/project/pip) from **20.2** to **20.2.1**. <details> <summary>Changelog</summary> ### 20.2.1 ``` =================== Features -------- - Ignore require-virtualenv in ``pip list`` (`8603 <https://github.com/pypa/pip/issues/8603>`_) Bug Fixes --------- - Correctly find already-installed distributions with dot (``.``) in the name and uninstall them when needed. (`8645 <https://github.com/pypa/pip/issues/8645>`_) - Trace a better error message on installation failure due to invalid ``.data`` files in wheels. (`8654 <https://github.com/pypa/pip/issues/8654>`_) - Fix SVN version detection for alternative SVN distributions. (`8665 <https://github.com/pypa/pip/issues/8665>`_) - New resolver: Correctly include the base package when specified with extras in ``--no-deps`` mode. (`8677 <https://github.com/pypa/pip/issues/8677>`_) - Use UTF-8 to handle ZIP archive entries on Python 2 according to PEP 427, so non-ASCII paths can be resolved as expected. (`8684 <https://github.com/pypa/pip/issues/8684>`_) Improved Documentation ---------------------- - Add details on old resolver deprecation and removal to migration documentation. (`8371 <https://github.com/pypa/pip/issues/8371>`_) - Fix feature flag name in docs. (`8660 <https://github.com/pypa/pip/issues/8660>`_) ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pip - Changelog: https://pyup.io/changelogs/pip/ - Homepage: https://pip.pypa.io/ </details> Co-authored-by: pyup-bot <github-bot@pyup.io>
This commit partly reverts ccfa788 which took into account pypa/pip#8645.
Hi,
I've got an issue while installing namespace distribution dependencies. While it worked fine with
pip==20.1.1
resolving fails withpip==20.2
.My namespace distributions follow PEP420. However, I use a slightly different naming scheme than proposed in https://github.com/pypa/sample-namespace-packages/tree/master/native.
To reproduce the issue the following steps need to be executed:
pip
version:pkg_a
:pkg_b
which should fail:Though, when naming the namespace distributions as described in https://github.com/pypa/sample-namespace-packages/tree/master/native i.e. with a
_
instead of a.
, the distributions install correctly.It took me a while until I noted that the issue is the naming convention, I didn't follow thoroughly.
Question: Is the change from
pip==20.1.1
topip==20.2
on purpose?If you need any further details, let me know.
The text was updated successfully, but these errors were encountered: