Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ The minimum Apache Airflow version supported by this provider distribution is ``

{%- if CROSS_PROVIDERS_DEPENDENCIES %}

Cross provider package dependencies
-----------------------------------
Optional cross provider package dependencies
--------------------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider distributions in order to use them.
Expand All @@ -87,6 +87,7 @@ You can install such cross-provider dependencies when installing from PyPI. For


{{ CROSS_PROVIDERS_DEPENDENCIES_TABLE_RST | safe }}
{%- endif %}

Downloading official packages
-----------------------------
Expand All @@ -96,7 +97,3 @@ You can download officially released packages and verify their checksums and sig

* `The {{ PACKAGE_PIP_NAME }} {{ RELEASE }}{{ VERSION_SUFFIX }} sdist package <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}.tar.gz.sha512>`__)
* `The {{ PACKAGE_PIP_NAME }} {{ RELEASE }}{{ VERSION_SUFFIX }} wheel package <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/{{ PACKAGE_DIST_PREFIX }}-{{ RELEASE }}{{ VERSION_SUFFIX }}-py3-none-any.whl.sha512>`__)



{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ Requirements
{%- endif %}
{%- if CROSS_PROVIDERS_DEPENDENCIES %}

Cross provider package dependencies
-----------------------------------
Optional cross provider package dependencies
--------------------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.
Expand Down
32 changes: 30 additions & 2 deletions dev/breeze/src/airflow_breeze/utils/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,34 @@ def get_cross_provider_dependent_packages(provider_id: str) -> list[str]:
return get_provider_dependencies()[provider_id]["cross-providers-deps"]


def get_cross_provider_dependencies_for_extras(provider_id: str) -> list[str]:
Comment thread
guan404ming marked this conversation as resolved.
"""Return cross-provider dependencies that can be rendered as installable extras.

``cross-providers-deps`` is an import-level graph. Some entries are already
required dependencies, so they should not be documented as ``pkg[extra]``.
This mirrors the filtering used when generating provider ``pyproject.toml``.
"""
cross_provider_dependencies = get_cross_provider_dependent_packages(provider_id)
if not cross_provider_dependencies:
return []

from packaging.requirements import Requirement
from packaging.utils import canonicalize_name

suspended_provider_ids = get_suspended_provider_ids()
required_package_names = {
canonicalize_name(Requirement(requirement).name)
for requirement in get_provider_requirements(provider_id)
}

return [
cross_provider_id
for cross_provider_id in cross_provider_dependencies
if cross_provider_id not in suspended_provider_ids
and canonicalize_name(get_pip_package_name(cross_provider_id)) not in required_package_names
]


def get_license_files(provider_id: str) -> str:
if provider_id == "fab":
return str(["LICENSE", "NOTICE", "3rd-party-licenses/LICENSES-*"]).replace('"', "'")
Expand All @@ -700,7 +728,7 @@ def get_provider_jinja_context(
supported_python_versions = [
p for p in ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS if p not in provider_details.excluded_python_versions
]
cross_providers_dependencies = get_cross_provider_dependent_packages(provider_id=provider_id)
cross_providers_dependencies = get_cross_provider_dependencies_for_extras(provider_id)

requires_python_version: str = f">={DEFAULT_PYTHON_MAJOR_MINOR_VERSION}"
# Most providers require the same python versions, but some may have exclusions
Expand Down Expand Up @@ -729,7 +757,7 @@ def get_provider_jinja_context(
"MIN_AIRFLOW_VERSION": get_min_airflow_version(provider_id),
"PROVIDER_REMOVED": provider_details.removed,
"PROVIDER_INFO": get_provider_info_dict(provider_id),
"CROSS_PROVIDERS_DEPENDENCIES": get_cross_provider_dependent_packages(provider_id),
"CROSS_PROVIDERS_DEPENDENCIES": cross_providers_dependencies,
"CROSS_PROVIDERS_DEPENDENCIES_TABLE_RST": convert_cross_package_dependencies_to_table(
cross_providers_dependencies, markdown=False
),
Expand Down
39 changes: 39 additions & 0 deletions dev/breeze/tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
expand_all_provider_distributions,
find_matching_long_package_names,
get_available_distributions,
get_cross_provider_dependencies_for_extras,
get_cross_provider_dependent_packages,
get_dist_package_name_prefix,
get_long_package_name,
Expand Down Expand Up @@ -263,6 +264,44 @@ def test_get_min_airflow_version(provider_id: str, min_version: str):
assert get_min_airflow_version(provider_id) == min_version


@pytest.mark.parametrize(
("cross_provider_deps", "suspended_ids", "requirements", "expected"),
[
pytest.param(
["common.compat", "common.sql", "google", "apache.beam"],
["apache.beam"],
["apache-airflow-providers-common-compat>=1.2.3"],
["common.sql", "google"],
id="filters_suspended_and_required",
),
pytest.param(
["common.sql"],
[],
["apache-airflow-providers-common-sql-extra>=1.0.0"],
["common.sql"],
id="substring_collision_not_filtered",
),
],
)
def test_get_cross_provider_dependencies_for_extras(
monkeypatch, cross_provider_deps, suspended_ids, requirements, expected
):
monkeypatch.setattr(
"airflow_breeze.utils.packages.get_cross_provider_dependent_packages",
lambda provider_id: cross_provider_deps,
)
monkeypatch.setattr(
"airflow_breeze.utils.packages.get_suspended_provider_ids",
lambda: suspended_ids,
)
monkeypatch.setattr(
"airflow_breeze.utils.packages.get_provider_requirements",
lambda provider_id: requirements,
)

assert get_cross_provider_dependencies_for_extras("test.provider") == expected


def test_convert_cross_package_dependencies_to_table():
EXPECTED = """
| Dependent package | Extra |
Expand Down
19 changes: 0 additions & 19 deletions providers/airbyte/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,5 @@ PIP package Version required
``requests`` ``>=2.32.0``
========================================== ===================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-airbyte[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-airbyte/5.5.1/changelog.html>`_.
19 changes: 0 additions & 19 deletions providers/airbyte/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,6 @@ PIP package Version required
``requests`` ``>=2.32.0``
========================================== ===================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider distributions in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-airbyte[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

Downloading official packages
-----------------------------

Expand Down
19 changes: 0 additions & 19 deletions providers/akeyless/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,6 @@ PIP package Version required
``akeyless`` ``>=5.0.0``
========================================== ==================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-akeyless[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

Optional dependencies
----------------------

Expand Down
19 changes: 0 additions & 19 deletions providers/akeyless/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,6 @@ PIP package Version required
``akeyless`` ``>=5.0.0``
========================================== ==================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider distributions in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-akeyless[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

Downloading official packages
-----------------------------

Expand Down
19 changes: 0 additions & 19 deletions providers/alibaba/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,5 @@ PIP package Version required
``pyodps`` ``>=0.12.5.1; python_version >= "3.13"``
========================================== ========================================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-alibaba[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-alibaba/3.3.9/changelog.html>`_.
19 changes: 0 additions & 19 deletions providers/alibaba/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,6 @@ PIP package Version required
``pyodps`` ``>=0.12.5.1; python_version >= "3.13"``
========================================== ========================================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider distributions in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-alibaba[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

Downloading official packages
-----------------------------

Expand Down
7 changes: 2 additions & 5 deletions providers/amazon/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ PIP package Version required
``marshmallow`` ``>=3``
========================================== ======================================

Cross provider package dependencies
-----------------------------------
Optional cross provider package dependencies
--------------------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.
Expand All @@ -90,13 +90,10 @@ Dependent package
======================================================================================================================== ====================
`apache-airflow-providers-apache-hive <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive>`_ ``apache.hive``
`apache-airflow-providers-cncf-kubernetes <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes>`_ ``cncf.kubernetes``
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
`apache-airflow-providers-common-messaging <https://airflow.apache.org/docs/apache-airflow-providers-common-messaging>`_ ``common.messaging``
`apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
`apache-airflow-providers-exasol <https://airflow.apache.org/docs/apache-airflow-providers-exasol>`_ ``exasol``
`apache-airflow-providers-ftp <https://airflow.apache.org/docs/apache-airflow-providers-ftp>`_ ``ftp``
`apache-airflow-providers-google <https://airflow.apache.org/docs/apache-airflow-providers-google>`_ ``google``
`apache-airflow-providers-http <https://airflow.apache.org/docs/apache-airflow-providers-http>`_ ``http``
`apache-airflow-providers-imap <https://airflow.apache.org/docs/apache-airflow-providers-imap>`_ ``imap``
`apache-airflow-providers-microsoft-azure <https://airflow.apache.org/docs/apache-airflow-providers-microsoft-azure>`_ ``microsoft.azure``
`apache-airflow-providers-mongo <https://airflow.apache.org/docs/apache-airflow-providers-mongo>`_ ``mongo``
Expand Down
7 changes: 2 additions & 5 deletions providers/amazon/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ PIP package Version required
``marshmallow`` ``>=3``
========================================== ======================================

Cross provider package dependencies
-----------------------------------
Optional cross provider package dependencies
--------------------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider distributions in order to use them.
Expand All @@ -148,13 +148,10 @@ Dependent package
======================================================================================================================== ====================
`apache-airflow-providers-apache-hive <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive>`_ ``apache.hive``
`apache-airflow-providers-cncf-kubernetes <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes>`_ ``cncf.kubernetes``
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
`apache-airflow-providers-common-messaging <https://airflow.apache.org/docs/apache-airflow-providers-common-messaging>`_ ``common.messaging``
`apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
`apache-airflow-providers-exasol <https://airflow.apache.org/docs/apache-airflow-providers-exasol>`_ ``exasol``
`apache-airflow-providers-ftp <https://airflow.apache.org/docs/apache-airflow-providers-ftp>`_ ``ftp``
`apache-airflow-providers-google <https://airflow.apache.org/docs/apache-airflow-providers-google>`_ ``google``
`apache-airflow-providers-http <https://airflow.apache.org/docs/apache-airflow-providers-http>`_ ``http``
`apache-airflow-providers-imap <https://airflow.apache.org/docs/apache-airflow-providers-imap>`_ ``imap``
`apache-airflow-providers-microsoft-azure <https://airflow.apache.org/docs/apache-airflow-providers-microsoft-azure>`_ ``microsoft.azure``
`apache-airflow-providers-mongo <https://airflow.apache.org/docs/apache-airflow-providers-mongo>`_ ``mongo``
Expand Down
Loading
Loading