Skip to content
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

Packaging requirements #3307

Merged
merged 1 commit into from
Mar 22, 2016
Merged

Conversation

s-t-e-v-e-n-k
Copy link
Contributor

Stop using pkg_resources.Requirements inside pip to represent parsed requirements, instead make use of packaging.requirements.Requirement to do so.

Review on Reviewable

@s-t-e-v-e-n-k s-t-e-v-e-n-k force-pushed the packaging-requirements branch 2 times, most recently from 114d234 to 39fa956 Compare December 18, 2015 03:58
@s-t-e-v-e-n-k s-t-e-v-e-n-k changed the title DNR: Packaging requirements Packaging requirements Feb 9, 2016
@s-t-e-v-e-n-k s-t-e-v-e-n-k force-pushed the packaging-requirements branch 3 times, most recently from 8122856 to 075fbc6 Compare February 11, 2016 03:21
@@ -361,7 +361,7 @@ def _correct_build_location(self):
def name(self):
if self.req is None:
return None
return native_str(self.req.project_name)
return native_str(pkg_resources.safe_name(self.req.name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use packaging.utils.canonicalize_name ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but canonicalize_name also lowercases the result, which is bad, since it turns up in the output of pip, which breaks the test suite, and also impacts uninstallability.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it impact uninstallability ?

@chefren
Copy link

chefren commented May 13, 2016

I think I am seeing the same issue, with a local devpi-server and the module zope.deprecation

(test_env)tester@devpi-VirtualBox:$ pip list
pip (8.1.1)
setuptools (21.0.0)
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(test_env)tester@devpi-VirtualBox:
$ export PIP_INDEX_URL=http://127.0.0.1:3141/xxxx/master
(test_env)tester@devpi-VirtualBox:$ pip install zope.deprecation --no-cache-dir
Collecting zope.deprecation
Downloading http://127.0.0.1:3141/root/pypi/+f/e9a/663ded58f4f9f/zope.deprecation-4.1.2.tar.gz (146kB)
(test_env)tester@devpi-VirtualBox:
$ pip list
pip (8.1.1)
setuptools (21.0.0)
zope.deprecation (4.1.2)

Then when updating pip only:

(test_env)tester@devpi-VirtualBox:$ pip list
pip (8.1.2)
setuptools (21.0.0)
(test_env)tester@devpi-VirtualBox:
$ pip install zope.deprecation -vv --no-cache-dir
Collecting zope.deprecation
1 location(s) to search for versions of zope.deprecation:
http://127.0.0.1:3141/xxxx/master/zope-deprecation/
Getting page http://127.0.0.1:3141/xxxx/master/zope-deprecation/
Starting new HTTP connection (1): 127.0.0.1
"GET /xxxx/master/zope-deprecation/ HTTP/1.1" 302 207
"GET /xxxx/master/+simple/zope-deprecation HTTP/1.1" 200 146
Analyzing links from page http://127.0.0.1:3141/xxxx/master/+simple/zope-deprecation
Could not find a version that satisfies the requirement zope.deprecation (from versions: )
Cleaning up...
No matching distribution found for zope.deprecation
Exception information:
Traceback (most recent call last):
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/commands/install.py", line 299, in run
requirement_set.prepare_files(finder)
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 522, in _prepare_file
finder, self.upgrade, require_hashes)
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/req/req_install.py", line 268, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/home/tester/test_env/local/lib/python2.7/site-packages/pip/index.py", line 491, in find_requirement
'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for zope.deprecation

However, it seems to work when going straight to the pypi server:

(test_env)tester@devpi-VirtualBox:$ unset PIP_INDEX_URL
(test_env)tester@devpi-VirtualBox:
$ pip list
pip (8.1.2)
setuptools (21.0.0)
(test_env)tester@devpi-VirtualBox:~$ pip install zope.deprecation -vv --no-cache-dir
Collecting zope.deprecation
1 location(s) to search for versions of zope.deprecation:
https://pypi.python.org/simple/zope-deprecation/
Getting page https://pypi.python.org/simple/zope-deprecation/
...
InsecurePlatformWarning
"GET /simple/zope-deprecation/ HTTP/1.1" 200 957
Analyzing links from page https://pypi.python.org/simple/zope-deprecation/
...
Using version 4.1.2 (newest of versions: 3.3.0, 3.4.0, 3.4.1, 3.5.0, 3.5.1, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2)
"GET /packages/c1/d3/3919492d5e57d8dd01b36f30b34fc8404a30577392b1eb817c303499ad20/zope.deprecation-4.1.2.tar.gz HTTP/1.1" 200 146327
Downloading zope.deprecation-4.1.2.tar.gz (146kB)
Downloading from URL https://pypi.python.org/packages/c1/d3/3919492d5e57d8dd01b36f30b34fc8404a30577392b1eb817c303499ad20/zope.deprecation-4.1.2.tar.gz#md5=e9a663ded58f4f9f7881beb56cae2782 (from https://pypi.python.org/simple/zope-deprecation/)
...

Is it possible that the devpi-server could just work with a different configuration? Why could the bases fail if the versions do exist and work with pip 8.1.1?

The devpi-server is the latest:

(env)devpi@devpi-VirtualBox:~$ devpi-server --version
3.1.1

@RonnyPfannschmidt
Copy link
Contributor

devpi version 4 will include working pep 503 support and will need a database migration

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants