Opened 16 years ago

Closed 9 years ago

#8280 closed Bug (fixed)

Commands framework doesn't support alternate import methods

Reported by: jdetaeye Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: command zip
Cc: bhuztez@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

From this thread on the developer mailing list
http://groups.google.com/group/django-developers/browse_thread/thread/78975372cdfb7d1a#
I understand that the Django team is keen on supporting alternate ways of packaging django: in a zip-file, in a jar-file(Jython) or other "frozen" formats.

One place that'll need fixing to achieve this is to update the command framework.
The find available commands, the current Django code is browsing the command subdirectories and looking for files that end with a .py extension
To support alternate packaging, the code should use the proper Python APIs to iterate over the available modules in a package.

A patch along these lines was already included with #5825. (The patch would need updating to the SVN version however - Once this ticket is accepted I can take care of it.)

Attachments (3)

usercommands.patch (4.1 KB ) - added by jdetaeye 16 years ago.
patch included with #5825
ticket8280.patch (5.4 KB ) - added by jdetaeye 13 years ago.
patch updated to v1.3
zip_egg_fixed.diff (10.1 KB ) - added by bhuztez 12 years ago.
zip_egg_fixed from #14087, namespace_package_pth.5.diff should be applied before this patch

Download all attachments as: .zip

Change History (15)

by jdetaeye, 16 years ago

Attachment: usercommands.patch added

patch included with #5825

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

Given that this will be useful in more than just the management app (for example, finding the available db backends, as in #8238), it's probably worth putting a compat module in django.utils that provides the necessary functionality for all the Python versions we support (2.3 and up).

The idea seems necessary for our "Python on VMs" goal for 1.0.

comment:2 by Malcolm Tredinnick, 16 years ago

milestone: 1.0post-1.0

After discussion with Jacob, we think this isn't really a showstopper for 1.0. It's certainly possible to do without it (as Jython have managed) for now. After 1.0 it will certainly be a nice idea to implement, though.

The patch needs changing as mentioned in the above comment in order to keep things cleaner. Then it needs a bunch of testing on differently-backed Pythons (CPython, IronPython, PyPy and Jython) to make sure it works. Right now that requires time and could destabilise things.

comment:3 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

by jdetaeye, 13 years ago

Attachment: ticket8280.patch added

patch updated to v1.3

comment:4 by Luke Plant, 13 years ago

Easy pickings: unset
Patch needs improvement: set
Severity: Normal
Type: Bug

We no longer need to support anything less than Python 2.5, so this patch can be simplified. It then just confirmation that is works CPython/Jython/IronPython/PyPy.

comment:5 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:6 by bhuztez, 12 years ago

I guess zip_egg_fixed patch for #14087 should also fix this.

by bhuztez, 12 years ago

Attachment: zip_egg_fixed.diff added

zip_egg_fixed from #14087, namespace_package_pth.5.diff should be applied before this patch

comment:7 by bhuztez, 12 years ago

Cc: bhuztez@… added

take zip_egg_fixed from #14087, namespace_package_pth.5.diff should be applied before this patch.

comment:8 by Claude Paroz, 12 years ago

#19048 was a duplicate with a proposed patch

comment:9 by Aymeric Augustin, 11 years ago

Component: Core (Other)Core (Management commands)

comment:10 by Claude Paroz, 9 years ago

Patch needs improvement: unset

comment:11 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:12 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 6e1c9c6568c405bfa481dda4249abe2960173547:

Fixed #8280 -- Allowed management command discovery for eggs

Thanks jdetaeye for the report, bhuztez and jdetaeye for the
initial patches, Tim Graham and Berker Peksag for the reviews.

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