diff --git a/airflow-core/pyproject.toml b/airflow-core/pyproject.toml index a875d9e9c77e7..e84c78693293a 100644 --- a/airflow-core/pyproject.toml +++ b/airflow-core/pyproject.toml @@ -150,6 +150,7 @@ dependencies = [ "universal-pathlib>=0.3.8", "uuid6>=2024.7.10", "apache-airflow-task-sdk<1.4.0,>=1.3.0", + "apache-airflow-ctl<0.1.5,>=0.1.4", # pre-installed providers "apache-airflow-providers-common-compat>=1.7.4", "apache-airflow-providers-common-io>=1.6.3", @@ -322,6 +323,7 @@ required-version = ">=0.11.8" [tool.uv.sources] apache-airflow-core = {workspace = true} +apache-airflow-ctl = {workspace = true} apache-airflow-devel-common = { workspace = true } [tool.airflow] diff --git a/airflow-e2e-tests/tests/airflow_e2e_tests/basic_tests/test_airflowctl_imports.py b/airflow-e2e-tests/tests/airflow_e2e_tests/basic_tests/test_airflowctl_imports.py new file mode 100644 index 0000000000000..f7957f1a576eb --- /dev/null +++ b/airflow-e2e-tests/tests/airflow_e2e_tests/basic_tests/test_airflowctl_imports.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from __future__ import annotations + +import subprocess +import sys + + +def test_airflowctl_is_importable(): + # checks if airflowctl imports correctly + result = subprocess.run( + [ + sys.executable, + "-c", + "import airflowctl; print('airflowctl imported successfully')", + ], + capture_output=True, + text=True, + check=False, + ) + assert result.returncode == 0, ( + f"airflowctl import failed!\nstdout: {result.stdout}\nstderr: {result.stderr}" + ) diff --git a/uv.lock b/uv.lock index 30e362221b84a..c2cefb4bb7a04 100644 --- a/uv.lock +++ b/uv.lock @@ -1799,6 +1799,7 @@ dependencies = [ { name = "a2wsgi" }, { name = "aiosqlite" }, { name = "alembic" }, + { name = "apache-airflow-ctl" }, { name = "apache-airflow-providers-common-compat" }, { name = "apache-airflow-providers-common-io" }, { name = "apache-airflow-providers-common-sql" }, @@ -1926,6 +1927,7 @@ requires-dist = [ { name = "aiosqlite", specifier = ">=0.20.0,<0.22.0" }, { name = "alembic", specifier = ">=1.13.1,<2.0" }, { name = "apache-airflow-core", extras = ["graphviz", "gunicorn", "kerberos", "otel", "statsd"], marker = "extra == 'all'", editable = "airflow-core" }, + { name = "apache-airflow-ctl", editable = "airflow-ctl" }, { name = "apache-airflow-providers-common-compat", editable = "providers/common/compat" }, { name = "apache-airflow-providers-common-io", editable = "providers/common/io" }, { name = "apache-airflow-providers-common-sql", editable = "providers/common/sql" },