[Django] #28878: "pip install django" is broken on Python 2; can be fixed for most users with metadata

30 views
Skip to first unread message

Django

unread,
Dec 3, 2017, 7:54:35 AM12/3/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
----------------------------------------------+------------------------
Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------------+------------------------
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
[https://packaging.python.org/tutorials/distributing-packages/#python-
requires 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 :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/28878>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 3, 2017, 10:43:46 AM12/3/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+--------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Sergey Fedoseev):

* cc: Sergey Fedoseev (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:1>

Django

unread,
Dec 3, 2017, 10:44:04 AM12/3/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Sergey Fedoseev):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:2>

Django

unread,
Dec 3, 2017, 6:34:04 PM12/3/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Zac Hatfield Dodds):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/9413 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!

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:3>

Django

unread,
Dec 22, 2017, 6:35:34 PM12/22/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: closed
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"32ade4d73b50aed77efdb9dd7371c17f89061afc" 32ade4d7]:
{{{
#!CommitTicketReference repository=""
revision="32ade4d73b50aed77efdb9dd7371c17f89061afc"
Fixed #28878 -- Added python_requires in setup.py and a warning for older
pips that don't recognize it.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:4>

Django

unread,
Dec 22, 2017, 6:37:25 PM12/22/17
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: closed
Component: Packaging | Version: 2.0

Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"45d89856fcf103e8f109e76eea548149bd7e0ced" 45d89856]:
{{{
#!CommitTicketReference repository=""
revision="45d89856fcf103e8f109e76eea548149bd7e0ced"
[2.0.x] Fixed #28878 -- Added python_requires in setup.py and a warning


for older pips that don't recognize it.

Backport of 32ade4d73b50aed77efdb9dd7371c17f89061afc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:5>

Django

unread,
Jan 25, 2018, 5:53:47 PM1/25/18
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Andy Grabow):

* status: closed => new
* resolution: fixed =>


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:6>

Django

unread,
Jan 25, 2018, 9:06:39 PM1/25/18
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: new
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Zac Hatfield Dodds):

Replying to [comment:6 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
[https://github.com/pypa/warehouse/issues/2170#issuecomment-360662369 I've
asked for an admin to do it for us]. We'll see what happens.

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:7>

Django

unread,
Jan 26, 2018, 5:40:46 AM1/26/18
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: closed
Component: Packaging | Version: 2.0
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Andy Grabow):

* status: new => closed
* resolution: => fixed


Comment:

okay, good to know! i hope this works out! should be possible for a
project as big as this!

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:8>

Django

unread,
Jan 26, 2018, 8:30:37 PM1/26/18
to django-...@googlegroups.com
#28878: "pip install django" is broken on Python 2; can be fixed for most users
with metadata
------------------------------------+------------------------------------

Reporter: Zac Hatfield Dodds | Owner: nobody
Type: Bug | Status: closed
Component: Packaging | Version: 2.0

Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Zac Hatfield Dodds):

Replying to [comment:8 Andy Grabow]:


> okay, good to know! i hope this works out! should be possible for a
project as big as this!

[https://github.com/pypa/warehouse/issues/2170#issuecomment-360945767 Yep,
all done] - this ticket is as resolved now as it can possibly be.

--
Ticket URL: <https://code.djangoproject.com/ticket/28878#comment:9>

Reply all
Reply to author
Forward
0 new messages