Opened 15 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)
Change History (15)
Changed 15 years ago by
Attachment: | usercommands.patch added |
---|
comment:1 Changed 15 years ago by
milestone: | → 1.0 |
---|---|
Triage Stage: | Unreviewed → Accepted |
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 Changed 15 years ago by
milestone: | 1.0 → post-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:4 Changed 13 years ago by
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.
Changed 12 years ago by
Attachment: | zip_egg_fixed.diff added |
---|
zip_egg_fixed from #14087, namespace_package_pth.5.diff should be applied before this patch
comment:7 Changed 12 years ago by
Cc: | bhuztez@… added |
---|
take zip_egg_fixed from #14087, namespace_package_pth.5.diff should be applied before this patch.
comment:9 Changed 11 years ago by
Component: | Core (Other) → Core (Management commands) |
---|
comment:10 Changed 9 years ago by
Patch needs improvement: | unset |
---|
comment:11 Changed 9 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
comment:12 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch included with #5825