Skip to content

Commit

Permalink
Merge branch 'main' into smtp_provider_configless
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala authored Feb 5, 2025
2 parents da5abd2 + 9161259 commit e3ba5a4
Show file tree
Hide file tree
Showing 41 changed files with 1,148 additions and 295 deletions.
4 changes: 1 addition & 3 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ labelPRBasedOnFilePath:
- providers/celery/**

provider:cloudant:
- providers/src/airflow/providers/cloudant/**/*
- docs/apache-airflow-providers-cloudant/**/*
- providers/tests/cloudant/**/*
- providers/cloudant/**

provider:cncf-kubernetes:
- airflow/example_dags/example_kubernetes_executor.py
Expand Down
7 changes: 7 additions & 0 deletions airflow/new_provider.yaml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
"removed"
]
},
"excluded-python-versions": {
"description": "List of python versions excluded for that provider",
"type": "array",
"items": {
"type": "string"
}
},
"integrations": {
"description": "List of integrations supported by the provider.",
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ def _regenerate_pyproject_toml(context: dict[str, Any], provider_details: Provid
trim_blocks=True,
keep_trailing_newline=True,
)

get_pyproject_toml_path.write_text(get_pyproject_toml_content)
get_console().print(
f"[info]Generated {get_pyproject_toml_path} for the {provider_details.provider_id} provider\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ classifiers = [
{% endfor %}
"Topic :: System :: Monitoring",
]
requires-python = "~=3.9"
requires-python = "{{ REQUIRES_PYTHON }}"

# The dependencies should be modified in place in the generated file
# Any change in the dependencies is preserved when the file is regenerated
Expand Down
8 changes: 8 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from airflow_breeze.global_constants import (
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS,
DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
PROVIDER_DEPENDENCIES,
PROVIDER_RUNTIME_DATA_SCHEMA_PATH,
REGULAR_DOC_PACKAGES,
Expand Down Expand Up @@ -788,6 +789,12 @@ def get_provider_jinja_context(
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_package_id=provider_id)

# Most providers require the same python versions, but some may have exclusions
requires_python_version: str = f"~={DEFAULT_PYTHON_MAJOR_MINOR_VERSION}"
for excluded_python_version in provider_details.excluded_python_versions:
requires_python_version += f",!={excluded_python_version}"

context: dict[str, Any] = {
"PROVIDER_ID": provider_details.provider_id,
"PACKAGE_PIP_NAME": get_pip_package_name(provider_details.provider_id),
Expand Down Expand Up @@ -825,6 +832,7 @@ def get_provider_jinja_context(
"PIP_REQUIREMENTS_TABLE_RST": convert_pip_requirements_to_table(
get_provider_requirements(provider_id), markdown=False
),
"REQUIRES_PYTHON": requires_python_version,
}
return context

Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ apache-airflow-providers-apprise
apache-airflow-providers-asana
apache-airflow-providers-atlassian-jira
apache-airflow-providers-celery
apache-airflow-providers-cloudant
apache-airflow-providers-cohere
apache-airflow-providers-common-compat
apache-airflow-providers-common-io
Expand Down
25 changes: 0 additions & 25 deletions docs/apache-airflow-providers-cloudant/changelog.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow/howto/variable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Storing Variables in Environment Variables

Airflow Variables can also be created and managed using Environment Variables. The environment variable
naming convention is :envvar:`AIRFLOW_VAR_{VARIABLE_NAME}`, all uppercase.
So if your variable key is ``FOO`` then the variable name should be ``AIRFLOW_VAR_FOO``.
So if your variable key is ``foo`` then the variable name should be ``AIRFLOW_VAR_FOO``.

For example,

Expand Down
31 changes: 26 additions & 5 deletions docs/apache-airflow/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This quick start guide will help you bootstrap an Airflow standalone instance on

.. note::

Successful installation requires a Python 3 environment. Starting with Airflow 2.7.0, Airflow supports Python 3.9, 3.10, 3.11 and 3.12.
Successful installation requires a Python 3 environment. Starting with Airflow 2.7.0, Airflow supports Python 3.9, 3.10, 3.11, and 3.12.

Only ``pip`` installation is currently officially supported.

Expand All @@ -44,15 +44,36 @@ This quick start guide will help you bootstrap an Airflow standalone instance on
The installation of Airflow is straightforward if you follow the instructions below. Airflow uses
constraint files to enable reproducible installation, so using ``pip`` and constraint files is recommended.

1. Set Airflow Home (optional):
1. **(Recommended) Create and Activate a Virtual Environment**:

To avoid issues such as the ``externally-managed-environment`` error, particularly on modern Linux distributions like Ubuntu 22.04+ and Debian 12+, it is highly recommended to install Airflow inside a Python virtual environment. This approach prevents conflicts with system-level Python packages and ensures smooth installation.

For more details on this error, see the Python Packaging Authority's explanation in the `PEP 668 documentation <https://peps.python.org/pep-0668/>`_.

.. code-block:: bash
# Create a virtual environment in your desired directory
python3 -m venv airflow_venv
# Activate the virtual environment
source airflow_venv/bin/activate
# Upgrade pip within the virtual environment
pip install --upgrade pip
# Optional: Deactivate the virtual environment when done
deactivate
2. **Set Airflow Home (optional)**:

Airflow requires a home directory, and uses ``~/airflow`` by default, but you can set a different location if you prefer. The ``AIRFLOW_HOME`` environment variable is used to inform Airflow of the desired location. This step of setting the environment variable should be done before installing Airflow so that the installation process knows where to store the necessary files.

.. code-block:: bash
export AIRFLOW_HOME=~/airflow
2. Install Airflow using the constraints file, which is determined based on the URL we pass:
3. Install Airflow using the constraints file, which is determined based on the URL we pass:

.. code-block:: bash
:substitutions:
Expand All @@ -69,15 +90,15 @@ constraint files to enable reproducible installation, so using ``pip`` and const
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
3. Run Airflow Standalone:
4. Run Airflow Standalone:

The ``airflow standalone`` command initializes the database, creates a user, and starts all components.

.. code-block:: bash
airflow standalone
4. Access the Airflow UI:
5. Access the Airflow UI:

Visit ``localhost:8080`` in your browser and log in with the admin account details shown in the terminal. Enable the ``example_bash_operator`` DAG in the home page.

Expand Down
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
"cloudant": {
"deps": [
"apache-airflow>=2.9.0",
"ibmcloudant==0.9.1 ; python_version >= \"3.10\""
"ibmcloudant==0.9.1;python_version>=\"3.10\""
],
"devel-deps": [],
"plugins": [],
Expand Down
62 changes: 62 additions & 0 deletions providers/cloudant/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

.. 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.
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
`PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
Package ``apache-airflow-providers-cloudant``

Release: ``4.1.0``


`IBM Cloudant <https://www.ibm.com/cloud/cloudant>`__


Provider package
----------------

This is a provider package for ``cloudant`` provider. All classes for this provider package
are in ``airflow.providers.cloudant`` python package.

You can find package information and changelog for the provider
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cloudant/4.1.0/>`_.

Installation
------------

You can install this package on top of an existing Airflow 2 installation (see ``Requirements`` below
for the minimum Airflow version supported) via
``pip install apache-airflow-providers-cloudant``

The package supports the following python versions: 3.10,3.11,3.12

Requirements
------------

================== =====================================
PIP package Version required
================== =====================================
``apache-airflow`` ``>=2.9.0``
``ibmcloudant`` ``==0.9.1; python_version >= "3.10"``
================== =====================================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-cloudant/4.1.0/changelog.html>`_.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ versions:
- 1.0.1
- 1.0.0

dependencies:
- apache-airflow>=2.9.0
# Even though 3.9 is excluded below, we need to make this python_version aware so that `uv` can generate a
# full lock file when building lock file from provider sources
- 'ibmcloudant==0.9.1 ; python_version >= "3.10"'

excluded-python-versions:
# ibmcloudant transitively brings in urllib3 2.x, but the snowflake provider has a dependency that pins
# urllib3 to 1.x on Python 3.9; thus we exclude those Python versions from taking the update
Expand All @@ -65,7 +59,7 @@ excluded-python-versions:
integrations:
- integration-name: IBM Cloudant
external-doc-url: https://www.ibm.com/cloud/cloudant
logo: /integration-logos/cloudant/Cloudant.png
logo: /docs/integration-logos/Cloudant.png
tags: [service]

hooks:
Expand Down
79 changes: 79 additions & 0 deletions providers/cloudant/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.

# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!

# IF YOU WANT TO MODIFY THIS FILE EXCEPT DEPENDENCIES, YOU SHOULD MODIFY THE TEMPLATE
# `pyproject_TEMPLATE.toml.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
[build-system]
requires = ["flit_core==3.10.1"]
build-backend = "flit_core.buildapi"

[project]
name = "apache-airflow-providers-cloudant"
version = "4.1.0"
description = "Provider package apache-airflow-providers-cloudant for Apache Airflow"
readme = "README.rst"
authors = [
{name="Apache Software Foundation", email="[email protected]"},
]
maintainers = [
{name="Apache Software Foundation", email="[email protected]"},
]
keywords = [ "airflow-provider", "cloudant", "airflow", "integration" ]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Framework :: Apache Airflow",
"Framework :: Apache Airflow :: Provider",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: System :: Monitoring",
]
requires-python = "~=3.9,!=3.9"

# The dependencies should be modified in place in the generated file
# Any change in the dependencies is preserved when the file is regenerated
dependencies = [
"apache-airflow>=2.9.0",
# Even though 3.9 is excluded below, we need to make this python_version aware so that `uv` can generate a
# full lock file when building lock file from provider sources
"ibmcloudant==0.9.1;python_version>=\"3.10\"",
]

[project.urls]
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-cloudant/4.1.0"
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-cloudant/4.1.0/changelog.html"
"Bug Tracker" = "https://github.com/apache/airflow/issues"
"Source Code" = "https://github.com/apache/airflow"
"Slack Chat" = "https://s.apache.org/airflow-slack"
"Twitter" = "https://x.com/ApacheAirflow"
"YouTube" = "https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/"

[project.entry-points."apache_airflow_provider"]
provider_info = "airflow.providers.cloudant.get_provider_info:get_provider_info"

[tool.flit.module]
name = "airflow.providers.cloudant"

[tool.pytest.ini_options]
ignore = "tests/system/"
Loading

0 comments on commit e3ba5a4

Please sign in to comment.