-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
pex does not resolve packages using -i switch when using pypi-server #270
Comments
Works with localshop and artifactory. pypiserver is not actually fetching packages on disk and mirroring maybe with a redirect or don't know why, and maybe that's why it's failing. Maybe it could be closed if no-one is interested in using 'pypiserver' a local pypi mirror. |
does adding a trailing slash improve things at all? e.g.
if not, repro steps on how to setup a similar pypiserver instance would be helpful. |
Installed pypi-server version 1.1.10:
Started pypi server using:
Using this
Using the following
Until now an upload to But when I try to execute pex:
with
I get:
Note that I am using python 2.6 as I need to create pex files for my production env which is really old but cannot be updated. $ python --version
Python 2.6.6 If I exclude the The trailing "/" makes no difference. |
Interesting is that if I don't have requests in my path:
The pypi-server reports:
And if I install requests:
and pypi-server reports:
|
After lots of testing I understand the following: Pex does not resolve packages from local repositories, at least the .tgz sources do not behave well. I understand the complexity of the resolver.py & http.py, and the work is much appreciated, but the problem is there, maybe a tighter integration with pip could solve the problem (use pip's api for fetching packages, or not use fetch but get from pips cache). Modern workflows require private pypi repos, pex should work with them :/ My current workflow is not to use -i for pex (download everything from public pypi) and copy my wheels in ~/.pex/build (pex's cache). Any suggestions please welcomed. |
Just for people that read this thread, you may work with pex and private repos by using pip for package resolving then load wheel dependencies from local cache
|
Lack of redirects support is notable when local PyPI server is used with fallback to official one. For example, that's how pypiserver implementation works. On the PyPI pages all the package links are relative, not absolute. What means that we cannot use original request url to construct full package url to fetch it, we should respect the url to where we were redirected. Without redirects resolution we end with the urls which our pypiserver cannot process and the HTTP 404 response obliviously will never match the md5 package digest, so we'll fail on verification stage in anyway. This fixes pex-tool#200 pex-tool#270
Lack of redirects support is notable when local PyPI server is used with fallback to official one. For example, that's how pypiserver implementation works. On the PyPI pages all the package links are relative, not absolute. What means that we cannot use original request url to construct full package url to fetch it, we should respect the url to where we were redirected. Without redirects resolution we end with the urls which our pypiserver cannot process and the HTTP 404 response obliviously will never match the md5 package digest, so we'll fail on verification stage in anyway. This fixes pex-tool#200 pex-tool#270
Lack of redirects support is notable when local PyPI server is used with fallback to official one. For example, that's how pypiserver implementation works. On the PyPI pages all the package links are relative, not absolute. What means that we cannot use original request url to construct full package url to fetch it, we should respect the url to where we were redirected. Without redirects resolution we end with the urls which our pypiserver cannot process and the HTTP 404 response obliviously will never match the md5 package digest, so we'll fail on verification stage in anyway. This fixes pex-tool#200 pex-tool#270
When using as ~/.pip/pip.conf
pip resolves packages correctly.
If using the -i switch to declare this particular index with pex the following happens:
At this point the contents of ~/.pex/build will be
This works fine with artifactory as a pypi server.
The text was updated successfully, but these errors were encountered: