New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get airflow version from importlib.metadata rather than hard-coding #12786
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,8 +134,8 @@ function initialization::initialize_base_variables() { | |
# otherwise it will use files/airflow-breeze-config/init.sh | ||
export INIT_SCRIPT_FILE=${INIT_SCRIPT_FILE:=""} | ||
|
||
# Read airflow version from the version.py | ||
AIRFLOW_VERSION=$(grep version "${AIRFLOW_SOURCES}/airflow/version.py" | awk '{print $3}' | sed "s/['+]//g") | ||
# Read airflow version from the setup.py. | ||
AIRFLOW_VERSION=$(python "${AIRFLOW_SOURCES}/setup.py" --version) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer not to run Python here if possible. While this is a reasonable expectation that Python is installed in the hos, there are still some cases where people will have python2 by default for example and i would rather keep it bash only. There is another case in the future where we will use those scripts in code spaces environment and vs code to run docker-only environment and i would not like to have to depend on Python there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Failed anyway :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course that all untill we rewrite breeze in python - which might change the whole approach: #12282 |
||
export AIRFLOW_VERSION | ||
|
||
# Whether credentials should be forwarded to inside the docker container | ||
|
@@ -194,7 +194,6 @@ function initialization::initialize_files_for_rebuild_check() { | |
"setup.cfg" | ||
"Dockerfile.ci" | ||
".dockerignore" | ||
"airflow/version.py" | ||
"airflow/www/package.json" | ||
"airflow/www/yarn.lock" | ||
"airflow/www/webpack.config.js" | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This line isn't strictly needed, it was just so that the only symbol in this module was
version
. For no god reason really)