#28878 closed Bug (fixed)
"pip install django" is broken on Python 2; can be fixed for most users with metadata
Reported by: | Zac Hatfield Dodds | Owned by: | nobody |
---|---|---|---|
Component: | Packaging | Version: | 2.0 |
Severity: | Release blocker | Keywords: | |
Cc: | Sergey Fedoseev | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For users on Python 2, 'pip install django' should install the latest compatible version, which is 1.11.x.
Unfortunately, it currently tries to install Django 2.0, and setup.py throws an error (the details are unimportant, except that it's a terrible user experience). This is unfortunately inevitable for users with very old versions of pip, who are therefore out of luck unless they upgrade it.
For any user with pip 9+ though, we can use the python-requires argument to 'setuptools.setup'. All users will then transparently get the latest version that is compatible with their Python, and all will be well.
http://www.python3statement.org/practicalities/ has a range of further advice on making this process as smooth as possible, including tips about setuptools versions and where to insert explicit warnings and errors for users who somehow get an incompatible version anyway.
I'd be happy to review any patches in relation to this, or help write them if someone can help with django-specific questions :-)
Change History (9)
comment:1 by , 7 years ago
Cc: | added |
---|
comment:2 by , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 7 years ago
Has patch: | set |
---|
follow-up: 7 comment:6 by , 7 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
After researching for quite a while, i found this ticket and that the actual problem has been kinda solved with django 2.0.1 (without mentioning it in the release notes tho).
BUT any python2 pip ist still trying to install django 2, because the packages currently uploaded to pypi need to be modified to also include this fix!
After getting in rage about this for almost two days now i can confirm that django==2.0.1 will not install in python2 (with a recent pip version) - YAY
BUT the original releases need to be updated, so that automated travis tests are not that complicated to setup and people can savely install the latest compatible django under python2.
comment:7 by , 7 years ago
Replying to Andy Grabow:
BUT any python2 pip ist still trying to install django 2, because the packages currently uploaded to pypi need to be modified to also include this fix!
We know - it's impossible to edit existing releases on PyPI, but I've asked for an admin to do it for us. We'll see what happens.
follow-up: 9 comment:8 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
okay, good to know! i hope this works out! should be possible for a project as big as this!
comment:9 by , 7 years ago
Replying to Andy Grabow:
okay, good to know! i hope this works out! should be possible for a project as big as this!
Yep, all done - this ticket is as resolved now as it can possibly be.
PR
I've made the patch against master, and included some notes on backporting and required edits to the PyPI listing in the pull description. Very happy to hear any feedback!