Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#944469: python3-argcomplete: activate global completion for bash when package is installed

88 views
Skip to first unread message

Daniel Kahn Gillmor

unread,
Nov 10, 2019, 10:30:03 AM11/10/19
to
Package: python3-argcomplete
Version: 1.8.1-1
Control: affects -1 bash-completion mailscripts diffoscope

python3-argcomplete ships the script
activate-global-python-argcomplete3, but never invokes it or ships its
output in a reasonable global location.

If the python3-argcomplete package shipped the output of that file in
some appropriate place (presumably under /usr/share/bash-completion
somewhere, though i don't understand bash-completion well enough to say
where) then systems with both bash-completion and python3-argcomplete
installed would get automatic tab completion for every
argcomplete-enabled script.

This is relevant at least for diffoscope (which ships its own individual
registration in /usr/share/bash-completion/completions/diffoscope) and
mailscripts (which hopefully will provide something comparable soon for
email-print-mime-structure https://bugs.debian.org/944434, and
potentially for other scripts as well).

Note that i would prefer it ships this global completion registration in
/usr someplace, rather than trying to manage it as a conffile in /etc.

Thanks for maintaining python3-argcomplete in debian!

--dkg

signature.asc

Marc Dequènes

unread,
Sep 21, 2022, 12:30:04 AM9/21/22
to
Quack Gabriel,

I salvaged python-argcomplete and I'm now looking at loading completions
when the package is installed but that does not work as planned. Could
you lend me a hand please?

python-argcomplete ships with a script
(activate-global-python-argcomplete) which installs completion in
/etc/bash_completion.d/python-argcomplete. It works very well but does
required a manual step and also leaves a file that users should not
modify in /etc.
I updated the package to use dh_bash-completion instead: the file is
properly installed but completion does not work.

I read on the wiki
(https://wiki.debian.org/Teams/BashCompletion/Proposals/Roadmap) that
you implemented dynamic load completion and I suspect this is the
problem here (I could not read the details though as the link is
broken). If bash-completion expects the config to be named after a
command then it will not work as python-argcomplete needs to be enabled
for every python command. Do I understand it well? Any idea how I could
do this integration?

Regards.
\_o<

--
Marc Dequènes

Stefano Rivera

unread,
Nov 4, 2023, 10:30:05 AM11/4/23
to
Hi Marc (2022.09.21_06:10:13_+0200)

I just had a look at this (following breadcrumbs from #1055321), and
staged a new upstream version in git, as well as a change to fix this
bug.

I don't think bash_completion provides any mechanism to install a global
plugin like this, except for /etc/bash_completion.d

See: https://github.com/scop/bash-completion/issues/1055 for a related
discussion.

So, /etc/bash_completion.d is the logical installation place.

I updated the package to put a thin loading shim into
/etc/bash_completion.d. That should be safe to have as a conffile.
I first went down the road of a symlink, but I think that could be
problematic if a package is left in the conffiles state.

Haven't uploaded it yet. Have a look, I'll probably upload next week.

Stefano

--
Stefano Rivera
http://tumbleweed.org.za/
+1 415 683 3272

Marc Dequènes

unread,
Nov 8, 2023, 5:20:04 AM11/8/23
to
Quack,

On 2023-11-04 23:22, Stefano Rivera wrote:

> I updated the package to put a thin loading shim into
> /etc/bash_completion.d. That should be safe to have as a conffile.
> I first went down the road of a symlink, but I think that could be
> problematic if a package is left in the conffiles state.

Thanks for digging in to it and providing a fix, as well as a version
bump too along the way :-).

I did not test it yet but that looks solid. Go ahead and upload when
you're ready, or I will when I have time.
0 new messages