'Auto-completion in Click does not work outside virtualenv
I have a Python script that is designed to make some basic text edits and accepts command line parameters. The whole project is enclosed in a virtual environment too.
I am using python Click module to accept command line parameters, which does support auto completion in bash. I have a basic setup.py file to install the main script as a command or in a virtual environment by using pip install --editable ..
Now let's say main script is called edits. I should use _EDITS_COMPLETE=bash_source edits to generate a bash script to be run and enables auto completion. This does work fine in a virtualenv, where the script gets generated. However, outside of it, the normal script output is given.
In another words, in virtualenv the script returns the correct auto complete script, but outside of it, nothing happens.
So where may the issue with this be? I expect it to generate auto complete script outside virtualenv too.
Link to repository with the script I am trying to use: https://github.com/Astra3/DiscordText
Solution 1:[1]
Run pip install click (or pip install -r requirements.txt) in our host environment (outside the virtual env) and it will work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cassio Santos |
