question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breeze2 autocomplete requires `click-complete` to be installed

See original GitHub issue

Apache 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
potiukcommented, Feb 4, 2022

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 the setup-autocomplete output should do the job.

2reactions
potiukcommented, Jan 31, 2022

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 why click-completion needs to be installed as “system” package

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found