You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/27 17:47:17 UTC

[GitHub] [airflow] potiuk opened a new issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

potiuk opened a new issue #21164:
URL: https://github.com/apache/airflow/issues/21164


   ### 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
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1026081191


   > 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
   
   Got it now 👍


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1026000481


   thank you for this question @Bowrna, I will add it in **setup.cfg** and I will see what will happen. It should be available


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1031516940


   > @potiuk what are you suggesting here, it is to avoid touching Breeze2, and instead, add in **airflow/docs** something like **apache-airflow-breeze2** and write some warning in yellow about the installation of **click-complete** as a system package.
   
   Yep. If it is not installed when you run Breeze2. 
   
   BTW. I might actually take a stab on it myself BTW. I had a discussion with Bowrna that made me thnk that maybe there is another problem. So do not bother about this one for a while. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1029958020


   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1026073737


   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1031495759


   @potiuk what are you suggesting here, it is to avoid touching Breeze2, and instead, add in **airflow/docs** something like **apache-airflow-breeze2** and write some warning in yellow about the installation of **click-complete**  as a system package.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1029584079


   @potiuk I replicated this issue again and again, in a container, local machine, and in a Google Cloud Machine, once ./Breeze2 is installed the error will appear for the first time, then is not possible to replicate, even deleting the `.build `directory. To replicate it has to be in an empty environment. So I did my last test in an Instance on Google Cloud.
   
   So to avoid this issue I suggest adding ad a pre-requirement: `python3 -m pip install click-completion` as a system package (correct me if I am wrong here), so the steps the user have to make will be similar to this (in a clean environment):
   
   * `sudo apt update`
   * `mkdir test && cd test && git clone https://github.com/edithturn/airflow.git $$ cd airflow/`
   * `sudo apt install python3.8-venv`
   * `sudo apt install python3-pip`
   * `python3 -m pip install click-completion`
   
   Then `./Breeze2` will not have any issue with the installation. But as I write the lines above, it didn't show the functionality of setup-autocomplete.
   
   **Note**: Even I installed click-completion as a part of the requirement, I CAN'T make a completion for Breeze2 work. (I am not sure if this could work or not, but in all the tests I did It didn't), I tested **breeze** setup completion and it works perfectly, but NOT BREEZE2.
   
   To test setup-autocomplete, I run it with sudo (this is other but which Bowrna is working): `sudo ./Breeze2 setup-autocomplete`
   
   In conclusion: Let me know if fixing the documentation to add these requirements could close this issue? or should I ask for help from other containers? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1024512954


   I reproduced, I am getting a similar issue with click-completion
   ![Screenshot from 2022-01-28 13-41-01](https://user-images.githubusercontent.com/58795858/151603625-e9245daf-b8f9-469b-a48c-eb5b4a2629d3.png)
   
   - I am seeing that the installation finished successfully even if this module is not installed, but then autocompletion doesn't work on Breeze
   ![Screenshot from 2022-01-28 13-41-01](https://user-images.githubusercontent.com/58795858/151604503-fe904656-24fa-432c-ade7-15880b47d3fd.png)
   ![Screenshot from 2022-01-28 13-50-36](https://user-images.githubusercontent.com/58795858/151604542-134f0d78-05e5-407f-90d7-17462a286f0b.png)
   
   The ERROR also made reference to click-completion: ERROR: Failed building wheel for click-completion. But then:
   `Running setup.py install for click-completion...done`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #21164:
URL: https://github.com/apache/airflow/issues/21164


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1031525333


   @potiuk I see, please if you need a test let me know, I can test it faster too, I have free credits on Google Cloud it could help. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1031516940


   > @potiuk what are you suggesting here, it is to avoid touching Breeze2, and instead, add in **airflow/docs** something like **apache-airflow-breeze2** and write some warning in yellow about the installation of **click-complete** as a system package.
   
   Yep. If it is not installed when you run Breeze2. 
   
   BTW. I might actually take a stab on it myself BTW. I had a discussion with Bowrna that made me think that maybe there is another problem. So do not bother about this one for a while. 
   
   This one might be a little "tricky" :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1026073737


   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn edited a comment on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn edited a comment on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1024512954


   I reproduced, I am getting a similar issue with click-completion
   ![Screenshot from 2022-01-28 13-41-01](https://user-images.githubusercontent.com/58795858/151603625-e9245daf-b8f9-469b-a48c-eb5b4a2629d3.png)
   
   - I am seeing that the installation finished successfully even if this module is not installed, but then autocompletion doesn't work on Breeze
   
   ![Screenshot from 2022-01-28 13-50-36](https://user-images.githubusercontent.com/58795858/151604914-88a72a04-e83a-429f-a074-3ff966eb1f0f.png)
   
   The ERROR also made reference to click-completion: ERROR: Failed building wheel for click-completion. But then:
   `Running setup.py install for click-completion...done`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1026071390


   > @potiuk I have one doubt in this. When we are using Breeze2 command, we will have the `dev/breeze` part pip installed in editable mode right in the user environment. In that case, if we have added `click_completion` in setup.cfg, wouldn't it be available in the environment?
   
   Not exactly. The tricky point is that you should be able to run Breeze WITHOUT activating the virtual environment. In fact this also happen when you use `pipx`. When you have no "click-complete" installed as "system package" then either `pipx` variant or the ./Breeze2 bootstrap will not work. Try it yourself:
   
   1) Have ./Breeze2 autocomplete installed (currently it updates the .zsh) script to activate the environment
   2) Make sure you have not activated the virtual env of Breeze 
   3) Make sure you have no `click-completion` installed (`pip uninstall click-completion`) . You could have it installed by accident before, but most users who will not have it and just run `pipx install` or use ./Breeze2 bootstrap will not have it either.
   
   This is what I get:
   
   ![image](https://user-images.githubusercontent.com/595491/151850211-7002cf12-a2d5-4b33-9525-38e9280afb14.png)
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1030539771


   > @potiuk I see that when we execute `./Breeze2`, it invokes breeze.py and click_completion error is thrown. So you are suggesting to move the installation part inside `setup_autocomplete` to avoid this error. Can you explain to me why does `./Breeze2` code should invoke the breeze.py file? I couldn't understand that part.
   > 
   > https://github.com/apache/airflow/blob/2f4a3d4d4008a95fc36971802c514fef68e8a5d4/Breeze2#L1-L83
   
   @potiuk could you share your view on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] edithturn commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
edithturn commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1024364560


   @potiuk please assign it to me, I am installing Linux Mint on Virtual Box


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1027142339


   @potiuk I see that when we execute `./Breeze2`, it invokes breeze.py and click_completion error is thrown. So you are suggesting to move the installation part inside `setup_autocomplete` to avoid this error. Can you explain to me why does `./Breeze2` code should invoke the breeze.py file? I couldn't understand that part.
   https://github.com/apache/airflow/blob/2f4a3d4d4008a95fc36971802c514fef68e8a5d4/Breeze2#L1-L83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on issue #21164: Breeze2 autocomplete requires `click-complete` to be installed

Posted by GitBox <gi...@apache.org>.
Bowrna commented on issue #21164:
URL: https://github.com/apache/airflow/issues/21164#issuecomment-1025996098


   @potiuk I have one doubt in this. When we are using Breeze2 command, we will have the `dev/breeze` part pip installed in editable mode right in the user environment. In that case, if we have added `click_completion` in setup.cfg, wouldn't it be available in the environment?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org