python 2 compatibility

30 views
Skip to first unread message

Jeremy Audet

unread,
Jan 15, 2014, 4:23:53 PM1/15/14
to django-e...@googlegroups.com
Hi all,

Is django-extensions fully compatible with Python 2? In particular, there are three scripts that I am curious about: dia2django.py [1], pipchecker.py [2] and dumpscript.py [3]. Are those scripts compatible with Python 2?

I help distribute django-extensions for Arch Linux. As part of this effort, two packages have been created: python-django-extensions [4] and python2-django-extensions [5]. The first package makes django-extensions available to Python 3 programs, and the second makes django-extensions available to Python 2 programs. I'd like it if the python2-django-extensions package didn't depend upon Python 3. However, all three scripts include a shebang that references /usr/bin/python (either directly or via /usr/bin/env). On Arch Linux, /usr/bin/python points to the Python 3 executable, and /usr/bin/python points to the Python 2 executable. Thus, the three scripts call Python 3.

I can include a patch in the python2-django-extensions package that make the scripts call Python 2. However, I will only do this if the three scripts are compatible with Python 2.

[1] https://github.com/django-extensions/django-extensions/blob/7d90cf67186a56975898bbe4eb3a8e6703e4671f/django_extensions/utils/dia2django.py
[2] https://github.com/django-extensions/django-extensions/blob/8dea36e40bcdc35a952300a5e97cf45122dfc2a9/django_extensions/management/commands/pipchecker.py
[3] https://github.com/django-extensions/django-extensions/blob/10c18675a1653526983a545506f19e34c6411606/django_extensions/management/commands/dumpscript.py
[4] https://aur.archlinux.org/packages/python-django-extensions/
[5] https://aur.archlinux.org/packages/python2-django-extensions/

--Jeremy

trbs

unread,
Jan 15, 2014, 5:59:58 PM1/15/14
to django-e...@googlegroups.com
Everything in Django-Extensions should be compatible with both Python2 and Python3 if this is not the case please provide a ticket and/or pull request so we can fix it.

Nothing in Django-Extensions should result in an executable on the path of the operating system. All commands are run via Django's "manage.py".

For all three files, dia2django.py, pipchecker.py and dumpscript.py, you can make a patch to remove the shebang line.
I have removed those in our repository as well so make sure there is no confusion about this.

Regards,
Trbs
Reply all
Reply to author
Forward
0 new messages