amoghrajesh commented on PR #35970: URL: https://github.com/apache/airflow/pull/35970#issuecomment-1833553200
> > > > @potiuk BTW, i do not see static checks failing in my env or here. Are they failing? > > > > > > > > > Could be intermittent - I see that recent docker has been failing more frequently in CI (likely 24.0.7 version has some stability issue - I still want to wait for 24.0.8 that should get out any time soon because 24.0.7 has important security fixes https://docs.docker.com/engine/release-notes/24.0/#security) > > > > > > Yeah looks like it. Sure, thanks for the update > > Nope. It's a real issue: > > ``` > - hook id: check-breeze-top-dependencies-limited > - exit code: 1 > > Traceback (most recent call last): > File "dev/breeze/src/airflow_breeze/breeze.py", line 36, in <module> > from airflow_breeze.commands.release_management_commands import release_management # noqa > File "/home/runner/actions-runner/_work/airflow/airflow/dev/breeze/src/airflow_breeze/commands/release_management_commands.py", line 37, in <module> > from packaging.version import Version > ModuleNotFoundError: No module named 'packaging' > Breeze should only use limited dependencies when imported (see errors above). > ``` > >  > > This is the error: > > > Breeze should only use limited dependencies when imported (see errors above). > > You have to make sure that `packaging` is locally imported not at the top-level. The problem is that when you do auto-completion, the auto-completion script will parse all the commands and `click` decorators. And in order to do that, it has to import the command modules. And this happens in a very "plain" python environment of python where no dependencies are installed (except rich and click) - the autocomplete script runs outside of the `breeze` venv (and this is not something we can or should change). > > This means that you cannot add 3rd-party imports as top-level imports in the command files. This also allows auto-complete to be fast, because it will not import unnecessary a lot of packages. > > This pre-commit failing checks that. Sweet explanation. Yes, I remember hitting this earlier in the past. I am pushing a fix for 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
