Breeze2 autocomplete requires `click-complete` to be installed
See original GitHub issueApache Airflow version
main (development)
What happened
When I setup autocomplete for Breeze2 on a “bare” system when I have no packages installed, It fails autocomplete with this error:
ModuleNotFoundError: No module named 'click_completion'
Traceback (most recent call last):
File "/home/jarek/.pyenv/versions/3.7.9/bin/Breeze2", line 33, in <module>
sys.exit(load_entry_point('apache-airflow-breeze', 'console_scripts', 'Breeze2')())
File "/home/jarek/.pyenv/versions/3.7.9/bin/Breeze2", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/jarek/.local/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 194, in load
module = import_module(match.group('module'))
File "/home/jarek/.pyenv/versions/3.7.9/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/jarek/code/airflow/dev/breeze/src/airflow_breeze/breeze.py", line 24, in <module>
import click_completion
ModuleNotFoundError: No module named 'click_completion'
It seems that “autocomplete” feature of Breeze2 requires click-completion
to be installed first. This is a small issue an small prerequisite but I think it is not handled by the currrent setup-autocomplete
The same happens if you install Breeze2 with pipx
.
What you expected to happen
I expect that click-completion
package is automatically installled in when ./Breeze2 setup-autocomplete
is executed.
Also it should be described in the documentation as prerequisite
How to reproduce
- make sure you have no packages installed in your Python “system environment” (for example:
pip list | xargs pip uninstall -y
) - type ./Breeze2<TAB>
Operating System
Linux Mint 20.1.3
Versions of Apache Airflow Providers
Not relevant
Deployment
Other
Deployment details
No airflow deployment
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:14 (14 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah . I think we have too many “variables” so for now indeed fixing it in docs will be enough. One more thing we could do is - instead of “doing” stuff in the “setup-autocomplete”, we could simply ask the user to make sure that “click-complete” is installed as system package.
Writing this as
[yellow]
warning and some example instructions (same as in docs) as thesetup-autocomplete
output should do the job.Basically the problem is that the user does not have the
.venv
from Breeze activated at the moment the TAB is pressed (it only gets activated once you run./Breeze2
command. That’s whyclick-completion
needs to be installed as “system” package