Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18055 closed Cleanup/optimization (invalid)

check early on for python < 2.6 and provide clear message

Reported by: Preston Holmes Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords: installation
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

With a number of areas in Django now being changed to remove 2.5 compatibility, it would make sense to check the python version very early on and give a clear message that Django requires Python >= 2.6

I've modeled the patch on how iPython handles it

Attachments (1)

version-check.diff (1.2 KB ) - added by Preston Holmes 12 years ago.

Download all attachments as: .zip

Change History (6)

by Preston Holmes, 12 years ago

Attachment: version-check.diff added

comment:1 by Preston Holmes, 12 years ago

refs #17965

comment:2 by Paul McMillan, 12 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Claude Paroz, 12 years ago

Not totally convinced by the django/__init__.py addition. If it is checked during setup, I think that those who don't use the setup to install might be clever enough to also check the minimal python version.

comment:4 by Jannis Leidel, 12 years ago

Resolution: invalid
Status: newclosed
Triage Stage: AcceptedDesign decision needed

I'm -1 on this, we clearly state this in the docs, and we shouldn't raise a ImportError when only someone tries to import the django module (which works fine with < 2.6). There is a reason the package installation metadata can include a trove classifier for each Python version. Anything else is just mind-boggling mean to our users.

comment:5 by Preston Holmes, 12 years ago

This only occurred to me when thinking about what kind of error people might get if they somehow manage to install Django on 2.5 given the bits and pieces that may not be compatible.

Yes this is about avoiding foot shooting. I looked in the various packaging docs about how to define a Python version dependency and I really couldn't find much of anything. The classifiers aren't used by PIP (or others?) to actually prevent installation on 2.5. So I looked at how another solid Python library handles this (iPython). My intent was not to be mean, just to avoid anyone needlessly befuddled by an error deeper in Django internals ;-)

While import django works in < 2.6, isn't that asking for trouble? I would think that Django as a whole requires 2.6, even if some of its components work fine with 2.5

I think either way this is an edge case of usage (diminishing numbers of 2.5 users, esp by the time of Django 1.5 release) - So I have no strong opinion about this being accepted or rejected.

Note: See TracTickets for help on using tickets.
Back to Top