From a9e6077df4b084e7f05cc399931b0a5a1207994d Mon Sep 17 00:00:00 2001 From: Dev-iL <6509619+Dev-iL@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:15:24 +0300 Subject: [PATCH] Add the `upgrade_sqlalchemy` breeze flag + Fix some existing shellcheck violations --- Dockerfile.ci | 20 ++- dev/breeze/doc/images/output_shell.svg | 52 ++++---- dev/breeze/doc/images/output_shell.txt | 2 +- .../doc/images/output_testing_core-tests.svg | 100 ++++++++------- .../doc/images/output_testing_core-tests.txt | 2 +- .../images/output_testing_providers-tests.svg | 118 +++++++++--------- .../images/output_testing_providers-tests.txt | 2 +- .../airflow_breeze/commands/common_options.py | 6 + .../commands/developer_commands.py | 4 + .../commands/developer_commands_config.py | 1 + .../commands/testing_commands.py | 6 + .../commands/testing_commands_config.py | 1 + .../src/airflow_breeze/params/shell_params.py | 2 + scripts/ci/docker-compose/devcontainer.env | 1 + scripts/docker/entrypoint_ci.sh | 21 +++- 15 files changed, 200 insertions(+), 138 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index 7f4955df13e54..70552cc35d754 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -995,13 +995,13 @@ function handle_mount_sources() { echo echo "${COLOR_BLUE}Mounted sources are removed, cleaning up mounted dist-info files${COLOR_RESET}" echo - rm -rf /usr/local/lib/python${PYTHON_MAJOR_MINOR_VERSION}/site-packages/apache_airflow*.dist-info/ + rm -rf /usr/local/lib/python"${PYTHON_MAJOR_MINOR_VERSION}"/site-packages/apache_airflow*.dist-info/ fi } function determine_airflow_to_use() { USE_AIRFLOW_VERSION="${USE_AIRFLOW_VERSION:=""}" - if [[ ${USE_AIRFLOW_VERSION} == "" && ${USE_DISTRIBUTIONS_FROM_DIST=} != "true" ]]; then + if [[ "${USE_AIRFLOW_VERSION}" == "" && "${USE_DISTRIBUTIONS_FROM_DIST}" != "true" ]]; then export PYTHONPATH=${AIRFLOW_SOURCES} echo echo "${COLOR_BLUE}Using airflow version from current sources${COLOR_RESET}" @@ -1032,7 +1032,7 @@ function determine_airflow_to_use() { # for the use in parallel runs in docker containers--no-cache is needed - otherwise there is # possibility of overriding temporary environments by multiple parallel processes uv run --no-cache /opt/airflow/scripts/in_container/install_development_dependencies.py \ - --constraint https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-${PYTHON_MAJOR_MINOR_VERSION}.txt + --constraint https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-"${PYTHON_MAJOR_MINOR_VERSION}".txt # Some packages might leave legacy typing module which causes test issues # shellcheck disable=SC2086 ${PACKAGING_TOOL_CMD} uninstall ${EXTRA_UNINSTALL_FLAGS} typing || true @@ -1067,6 +1067,19 @@ function check_boto_upgrade() { set +x } +function check_upgrade_sqlalchemy() { + if [[ "${UPGRADE_SQLALCHEMY}" != "true" ]]; then + return + fi + echo + echo "${COLOR_BLUE}Upgrading sqlalchemy to the latest version to run tests with it${COLOR_RESET}" + echo + set -x + # shellcheck disable=SC2086 + ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} --upgrade "sqlalchemy[asyncio]<2.1" "databricks-sqlalchemy>=2" + set +x +} + function check_downgrade_sqlalchemy() { if [[ ${DOWNGRADE_SQLALCHEMY=} != "true" ]]; then return @@ -1200,6 +1213,7 @@ handle_mount_sources determine_airflow_to_use environment_initialization check_boto_upgrade +check_upgrade_sqlalchemy check_downgrade_sqlalchemy check_downgrade_pendulum check_force_lowest_dependencies diff --git a/dev/breeze/doc/images/output_shell.svg b/dev/breeze/doc/images/output_shell.svg index bc3a6baecce93..8d11ddd644519 100644 --- a/dev/breeze/doc/images/output_shell.svg +++ b/dev/breeze/doc/images/output_shell.svg @@ -1,4 +1,4 @@ - +