potiuk commented on issue #21105: URL: https://github.com/apache/airflow/issues/21105#issuecomment-1096618618
> Should we also create a similar function in python? One who sets all these globals. Or should we approach this different in Python? Most of those (if not all) are already set in Global Constants and/or read from parameters and passed via BuildParams, or ShellParams I think however, there is one thing here that we might correct though (now when I think of it). `initialize-local-virtualenv` should not be "breeze" command :). This caused quite a confusion before - because this is really setting up "alternative" to breeze. It does not need most of those parameters that entering Breeze require (because it does not actually build or run docker image/container or docker compose) Also there is a bit of a problem here, because "breeze" has in fact its own virtualenv now, so running it using the same venv as "breeze" willl be quite problematic, because you will need to ... setup another venv from within Breeze venv. This is a bit mind-boggling when you think of it. I think the BEST approach is to simply have a separate python script to initialize local virtualenv that a) is executable python script in ./script/tools/initialize_virtualenv.py b) is completely independent from ./breeze and does not even use anythong from `./dev/breeze` c) does not need any dependencies (neither click nor rich - they are not needed essentially) d) checks if it is already run within a virtualenv (and if not - fails and asks the user to create and activate one) d) figures out python version (3.7, 3.8 etc. ) automatically by checking which python version is used (this is a problem in the current version - it requires --python version to match the actual python version the local venv uses and cryptically fails sometimes if they are not matching). I think really you need two things to run the "initialize-local-virtualenv" command: * location of airflow sources * python version So you don't even need to pass anything as parameter as you can get those automatically. Simply the user should: 1) create a venv 2) activate it 3) run `./scripts/tools/initialize-local-virtualenv.py` That should be the "user story" here. -- 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]
