Enabling autocomplete bash using setuptools

I have a couple of packages in PyPI , and I would like to enable autocomplete functions with both of them. How could you verify that Bash auto-complete should be installed at all (check /etc/bash_completionmaybe?), And how would you install it with setup.py (preferably with setuptools)?

+3
source share
2 answers

If you need OS level packages (i.e. bash-completion), you should distribute your library as an OS level package. That is, in .deb, .rpmetc. Some tips here:

, setuptools script Python. bash-completion, , .

+1

data_files:

from setuptools import setup
setup(
  ...
  data_files=[
      ('/etc/bash_completion.d/', ['extra/some_completion_script']),
    ]
)
+2

Source: https://habr.com/ru/post/1751972/


All Articles