#691638 zsh: completion for python -m should be implemented without import all modules

Package:
zsh
Source:
zsh
Description:
shell with lots of features
Submitter:
Sebastian Ramacher
Date:
2014-06-28 12:51:04 UTC
Severity:
normal
#691638#3
Date:
2012-10-27 20:52:59 UTC
From:
To:
The completion for "python -m" is pretty useless. According to the code
it tries to import every module. In view #691634 that just doesn't work
and furthermore warnings (e.g. from twisted.words.im) are displayed so
the screen gets messed up.

Additionally, the completion doesn't support submodules. For example,
"python -m bpython.c" doesn't complete to "python -m bpython.cli".

Regards

#691638#6
Date:
2012-10-28 16:55:04 UTC
From:
To:
Controlg: tags -1 + patch

Here is a preliminary patch that uses code based on bpython's
importcompletion to enumerate all modules. It also adds caching for the
list of modules and handles submodules better. The caching policy should be
improved, but I couldn't think of a clever way to determine whether it
should be updated or not.

Regards

#691638#13
Date:
2013-01-30 16:15:14 UTC
From:
To:
Attached is an updated patch. It improves the module detection a bit,
i.e modules which aren't run-able with python -m are not listed anymore.

Regards

#691638#18
Date:
2014-06-28 12:47:22 UTC
From:
To:
Hi Sebastian,

thanks for the report and the patches.

Sebastian Ramacher wrote:

I think such a patch is best suited to be applied upstream.
Unfortunately the patch no more applies against the current upstream
HEAD.

Can you send an updated patch which applies against the current
upstream HEAD (as available via git at
git://git.code.sf.net/p/zsh/code) and send it directly to upstream at
zsh-workers@zsh.org (and Cc this bug report)?

Thanks in advance!

P.S.: I suspect that adding python3.4 would be a good idea, too, if
you update the patch anyways.

		Regards, Axel