* ui_ux: => 0
* easy: => 0
Comment:
I tried to improve, but could not get it work with zip-archived eggs.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: bhuztez (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:12>
* needs_docs: 0 => 1
Comment:
with patch zip_egg_fixed.2.diff, django will be able to find all commands
in a package, if importer for that package implements interfaces explained
below and is not in sys.meta_path.
* '''importer.iter_modules(prefix=!'')'''
importer.iter_modules is not defined in PEP 302, however
pkgutil.ImpImporter does implement this method. Django would use this
interface to list all modules in the commands package.
* '''loader.get_filename(fullname)'''
loader.get_filename is defined in PEP 302. But this patch use it to
figure out search path of packages.
{{{
filename = loader.get_filename(fullname)
path_item = os.path.dirname(filename)
}}}
Just assume os.path.dirname would work out the search path.
* '''loader.is_package(fullname)'''
This is the same as loader.is_package defined in PEP 302.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:13>
Comment (by bhuztez):
update patch for revision 17517
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:14>
* needs_docs: 1 => 0
Comment:
namespace_package_pth.2.diff will not look up importer in
sys.path_importer_cache, since django do not support PEP 302 importer.
should find commands in modules loaded by PEP 302 importer be in another
ticket?
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:15>
Comment (by carljm):
The zip_egg_fixed patch should also fix #12206.
I can't seem to find a separate bug for the management-commands-in-eggs
issue, though I thought there was one. Yes, there should be a separate bug
for that (or more broadly, PEP 302 importers). It's confusing to have two
patches under development on a single ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:16>
Comment (by bhuztez):
> I thought there was one.
They are #8280 and #13587.
> It's confusing to have two patches under development on a single ticket.
the namespace_package_pth patch is cleaned up to address the problem of
finding command in namespace packages only, so that it could be applied
without further investigation. However, in practice, namespaced packages
are often being zip archived. So, we need a general solution for PEP 302
importers.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:17>
Comment (by bhuztez):
update namespace_package_pth and zip_egg_fixed for revision 17777.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:18>
* needs_better_patch: 1 => 0
* version: 1.2 => SVN
Comment:
I found #596 is a better place for patch zip_egg_fixed. I will move it
there.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:19>
* cc: alex@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:20>
Comment (by bhuztez):
the zip_egg_fixed patch is now maintained under #8280.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:21>
Comment (by bhuztez):
my pull request for the namespace_package_pth patch:
https://github.com/django/django/pull/178
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:22>
Comment (by Natim):
My patch for Python 1.4.1 : https://code.djangoproject.com/ticket/19048
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:23>
Comment (by DavidReynolds):
bhuztez' pull request certainly addresses the problem I am seeing, any way
we can move this forward?
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:25>
Comment (by kmtracey):
Alternate fix proposed in #20344.
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:26>
* cc: daevaorn@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:27>
Comment (by timo):
https://github.com/django/django/pull/866
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:28>
* needs_better_patch: 0 => 1
Comment:
From apollo13 on the pull request:
{{{
As I noted on the previous PR (#866) I'd like to see:
* Support for PEP 420
* Check other locations in Django for the same issues (app template
loaders etc come to mind)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:29>
* cc: drakkan (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14087#comment:30>