potiuk commented on PR #35970:
URL: https://github.com/apache/airflow/pull/35970#issuecomment-1833540925

   > > > @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 - not in the 
`breeze` venv. 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.


-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to