Skip to content

Commit 1f52a85

Browse files
authored
Fix local running of backcompat tests after we switched to UV (apache#48669)
We were including a real `airflow/__init__.py` which has the unfortunate side-effect of making `AIRFLOW_V_3_0_PLUS` find 3.0.0dev0 as the version! Oops. The fix for that is to mount an empyt init file instead (we need a file to keep the uv build etc happy) Also uninstall edge provider for 2.9, as that needs 2.10. Oh and volume mount devel-common as that is part of test code.
1 parent d447355 commit 1f52a85

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

scripts/ci/docker-compose/providers-and-tests-sources.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ services:
2929
# Remove airflow sources from container
3030
- ../../../empty:/opt/airflow/airflow-core/src
3131
# But keep airflow/__init__.py to make hatchling happy when building empty package
32-
- ../../../airflow-core/src/airflow/__init__.py:/opt/airflow/airflow-core/src/airflow/__init__.py
32+
- /dev/null:/opt/airflow/airflow-core/src/airflow/__init__.py
3333
# Remove task-sdk sources from container
3434
- ../../../empty:/opt/airflow/task-sdk/src
3535
# But keep task-sdk/a__init__.py to make hatchling happy when building empty package
36-
- ../../../task-sdk/src/airflow/sdk/__init__.py:/opt/airflow/task-sdk/src/airflow/sdk/__init__.py
36+
- /dev/null:/opt/airflow/task-sdk/src/airflow/sdk/__init__.py
37+
38+
- ../../../devel-common:/opt/airflow/devel-common
3739
# And keep tests
3840
- ../../../airflow-core/tests/:/opt/airflow/airflow-core/tests:cached
3941
# Mount providers to make sure that we have the latest providers - both tests and sources

scripts/in_container/install_airflow_and_providers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ def install_airflow_and_providers(
796796
"apache-airflow-providers-common-messaging",
797797
"apache-airflow-providers-git",
798798
]
799+
if version.minor < 10:
800+
providers_to_uninstall_for_airflow_2.append("apache-airflow-providers-edge")
799801
run_command(
800802
["uv", "pip", "uninstall", *providers_to_uninstall_for_airflow_2],
801803
github_actions=github_actions,

0 commit comments

Comments
 (0)