-
Notifications
You must be signed in to change notification settings - Fork 296
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
PyPI backend and redirections #38
Comments
Maybe two new options --cache-permanent-redirections and --permanent-redirections-url, the latter defaulting to http://pypi.python.org/simple/, performing a light HEAD request to know about redirections would do the trick in most cases. But that's not really keeping pypiserver simple. |
Thanks for your detailed bug report. If I had to fix that, I'd probably let pypiserver read a text file containing all the package names served by the mirror with the right case. We could then easily fix misspellings and redirect to the right URL on the mirror. I don't feel like making pypiserver do HTTP requests, so I reject your proposed solution. Isn't there an easy way to fix the mirror? |
On 05/01/2013 10:36 PM, Ralf Schmitt wrote:
would give a very good enough practical solution.
One can manually add redirections in that web server configuration for Of course, one could also write a WSGI app to put right in front of the |
@gracinet Do you think that a workaround would be to invoke |
@ankostis, nice to see some new activity around pypiserver ! If that helps you, I can try and reproduce again, then tell about the suggestion. As a side note, we were affected by this problem with pip, but with zc.buildout. I don't remember so well, but maybe the reading of the whole |
@gracinet I wouldn't want to burden you, but i would appreciate it if you remember some details to reproduce the error (even without the the pep381 mirror downstream). In any case i plan to release the new version v1.1.7 with the new usage-recommendation and then assume this bug to be fixed. In case it is not, please comment on it. |
@ankostis yes, it works with pip --extra-index-url on current pip 6 and setuptools 12 ! The behaviour is otherwise mostly the same than it was with older version with just --index-url, except that pip now issues one deprecation warning. That being said, we're calling this whole stack mostly through zc.buildout, which does not support multiple indexes (nor does easy_install, as far as I can see). Maybe an extension such as gp.vcsdevelop can provide a workaround, as it relies internally on pip, but I wouldn't bet on that too much, since it's meant to pull from remote VCSes anyway. Tests done on the same version of pep381 mirror as in 2013 (revived a backup). |
@gracinet When you say "behaviour is otherwise mostly the same", do you mean that you still cannot resolve misspelled dependencies? |
@ankostis yes I mean misspelled dependencies can't be resolved with pip install --index-url PYPISERVER_URL, but they can with --other-index-url (as you suggested). With --index-url only, the sequence is exactly the same as first described. |
rel-date. - Update maintainers. - Update python-classifiers. - Various README edits. - pypiserver#38: Update suggestion on welcome-file.
rel-date. - Update maintainers. - Update python-classifiers. - Various README edits. - pypiserver#38: Update suggestion on welcome-file. - Add ankostis to authors (so Ralf may avoid half harassment for this release).
Thanks a lot, considered resolved with the new |
#140 implemented redirection when un-normalized packages requested - not misspelled ones, but should probably cover 99% of cases. |
Hi, thanks for pypiserver, simple and useful !
Here's a tricky problem when running pypiserver with fallback to a mirror index, not sure if it should be fixed within pypiserver or not.
See also https://bitbucket.org/loewis/pep381client/issue/22
The main PyPI server does some 301 redirections (to fix some mispellings). That's not something a mirror can easily reproduce (see above cited issue on pep381client).
The combination of pypiserver and a mirror leads to installation errors.
Fixing one's spellings is not practically possible, because they occur a lot through dependencies.
Reproduction
Assume for instance that pypiserver does not hold packages for 'babel'.
Client applications (such as pip) try e.g., '/simple/babel' (proper spelling is 'Babel')
Workarounds
My workaround for now is to setup 301 redirections for commonly mispelled distributions in the mirror as well (in our case, the mirror is ours), but that's a maintenance burden and does not scale.
Another possibility is to manually add commonly mispelled distributions in pypiserver and use '-U'. That's insatisfactoy for the same reasons.
Conclusion
Mispellings in dependencies are really common, since many distribution authors don't even realize their spelling is wrong. Any idea ?
The text was updated successfully, but these errors were encountered: