diff --git a/airflow/providers/email/operators/email.py b/airflow/operators/email.py similarity index 100% rename from airflow/providers/email/operators/email.py rename to airflow/operators/email.py diff --git a/airflow/operators/email_operator.py b/airflow/operators/email_operator.py index 7a5459be9d023..135eb68f13f0b 100644 --- a/airflow/operators/email_operator.py +++ b/airflow/operators/email_operator.py @@ -15,14 +15,14 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""This module is deprecated. Please use `airflow.providers.email.operators.email`.""" +"""This module is deprecated. Please use `airflow.operators.email`.""" import warnings # pylint: disable=unused-import -from airflow.providers.email.operators.email import EmailOperator # noqa +from airflow.operators.email import EmailOperator # noqa warnings.warn( - "This module is deprecated. Please use `airflow.providers.email.operators.email`.", + "This module is deprecated. Please use `airflow.operators.email`.", DeprecationWarning, stacklevel=2 ) diff --git a/airflow/providers/email/PROVIDERS_CHANGES_2020.06.24.md b/airflow/providers/email/PROVIDERS_CHANGES_2020.06.24.md deleted file mode 100644 index 99caf3c9ccfc8..0000000000000 --- a/airflow/providers/email/PROVIDERS_CHANGES_2020.06.24.md +++ /dev/null @@ -1,18 +0,0 @@ - - -### Release 2020.6.24 - -| Commit | Committed | Subject | -|:-----------------------------------------------------------------------------------------------|:------------|:---------------------------------------------------------------------------| -| [12af6a080](https://github.com/apache/airflow/commit/12af6a08009b8776e00d8a0aab92363eb8c4e8b1) | 2020-06-19 | Final cleanup for 2020.6.23rc1 release preparation (#9404) | -| [c7e5bce57](https://github.com/apache/airflow/commit/c7e5bce57fe7f51cefce4f8a41ce408ac5675d13) | 2020-06-19 | Prepare backport release candidate for 2020.6.23rc1 (#9370) | -| [f6bd817a3](https://github.com/apache/airflow/commit/f6bd817a3aac0a16430fc2e3d59c1f17a69a15ac) | 2020-06-16 | Introduce 'transfers' packages (#9320) | -| [0b0e4f7a4](https://github.com/apache/airflow/commit/0b0e4f7a4cceff3efe15161fb40b984782760a34) | 2020-05-26 | Preparing for RC3 relase of backports (#9026) | -| [00642a46d](https://github.com/apache/airflow/commit/00642a46d019870c4decb3d0e47c01d6a25cb88c) | 2020-05-26 | Fixed name of 20 remaining wrongly named operators. (#8994) | -| [375d1ca22](https://github.com/apache/airflow/commit/375d1ca229464617780623c61c6e8a1bf570c87f) | 2020-05-19 | Release candidate 2 for backport packages 2020.05.20 (#8898) | -| [12c5e5d8a](https://github.com/apache/airflow/commit/12c5e5d8ae25fa633efe63ccf4db389e2b796d79) | 2020-05-17 | Prepare release candidate for backport packages (#8891) | -| [f3521fb0e](https://github.com/apache/airflow/commit/f3521fb0e36733d8bd356123e56a453fd37a6dca) | 2020-05-16 | Regenerate readme files for backport package release (#8886) | -| [92585ca4c](https://github.com/apache/airflow/commit/92585ca4cb375ac879f4ab331b3a063106eb7b92) | 2020-05-15 | Added automated release notes generation for backport operators (#8807) | -| [4bde99f13](https://github.com/apache/airflow/commit/4bde99f1323d72f6c84c1548079d5e98fc0a2a9a) | 2020-03-23 | Make airflow/providers pylint compatible (#7802) | -| [97a429f9d](https://github.com/apache/airflow/commit/97a429f9d0cf740c5698060ad55f11e93cb57b55) | 2020-02-02 | [AIRFLOW-6714] Remove magic comments about UTF-8 (#7338) | -| [9a04013b0](https://github.com/apache/airflow/commit/9a04013b0e40b0d744ff4ac9f008491806d60df2) | 2020-01-27 | [AIRFLOW-6646][AIP-21] Move protocols classes to providers package (#7268) | diff --git a/airflow/providers/email/README.md b/airflow/providers/email/README.md deleted file mode 100644 index 212c8a538c4ab..0000000000000 --- a/airflow/providers/email/README.md +++ /dev/null @@ -1,103 +0,0 @@ - - - -# Package apache-airflow-backport-providers-email - -Release: 2020.6.24 - -**Table of contents** - -- [Backport package](#backport-package) -- [Installation](#installation) -- [Compatibility](#compatibility) -- [Provider class summary](#provider-class-summary) - - [Operators](#operators) - - [Moved operators](#moved-operators) -- [Releases](#releases) - - [Release 2020.6.24](#release-2020624) - -## Backport package - -This is a backport providers package for `email` provider. All classes for this provider package -are in `airflow.providers.email` python package. - -**Only Python 3.6+ is supported for this backport package.** - -While Airflow 1.10.* continues to support Python 2.7+ - you need to upgrade python to 3.6+ if you -want to use this backport package. - - - -## Installation - -You can install this package on top of an existing airflow 1.10.* installation via -`pip install apache-airflow-backport-providers-email` - -## Compatibility - -For full compatibility and test status of the backport packages check -[Airflow Backport Package Compatibility](https://cwiki.apache.org/confluence/display/AIRFLOW/Backported+providers+packages+for+Airflow+1.10.*+series) - -# Provider classes summary - -In Airflow 2.0, all operators, transfers, hooks, sensors, secrets for the `email` provider -are in the `airflow.providers.email` package. You can read more about the naming conventions used -in [Naming conventions for provider packages](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#naming-conventions-for-provider-packages) - - -## Operators - - - - -### Moved operators - -| Airflow 2.0 operators: `airflow.providers.email` package | Airflow 1.10.* previous location (usually `airflow.contrib`) | -|:--------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------| -| [operators.email.EmailOperator](https://github.com/apache/airflow/blob/master/airflow/providers/email/operators/email.py) | [operators.email_operator.EmailOperator](https://github.com/apache/airflow/blob/v1-10-stable/airflow/operators/email_operator.py) | - - - - - - - - - - - -## Releases - -### Release 2020.6.24 - -| Commit | Committed | Subject | -|:-----------------------------------------------------------------------------------------------|:------------|:---------------------------------------------------------------------------| -| [12af6a080](https://github.com/apache/airflow/commit/12af6a08009b8776e00d8a0aab92363eb8c4e8b1) | 2020-06-19 | Final cleanup for 2020.6.23rc1 release preparation (#9404) | -| [c7e5bce57](https://github.com/apache/airflow/commit/c7e5bce57fe7f51cefce4f8a41ce408ac5675d13) | 2020-06-19 | Prepare backport release candidate for 2020.6.23rc1 (#9370) | -| [f6bd817a3](https://github.com/apache/airflow/commit/f6bd817a3aac0a16430fc2e3d59c1f17a69a15ac) | 2020-06-16 | Introduce 'transfers' packages (#9320) | -| [0b0e4f7a4](https://github.com/apache/airflow/commit/0b0e4f7a4cceff3efe15161fb40b984782760a34) | 2020-05-26 | Preparing for RC3 relase of backports (#9026) | -| [00642a46d](https://github.com/apache/airflow/commit/00642a46d019870c4decb3d0e47c01d6a25cb88c) | 2020-05-26 | Fixed name of 20 remaining wrongly named operators. (#8994) | -| [375d1ca22](https://github.com/apache/airflow/commit/375d1ca229464617780623c61c6e8a1bf570c87f) | 2020-05-19 | Release candidate 2 for backport packages 2020.05.20 (#8898) | -| [12c5e5d8a](https://github.com/apache/airflow/commit/12c5e5d8ae25fa633efe63ccf4db389e2b796d79) | 2020-05-17 | Prepare release candidate for backport packages (#8891) | -| [f3521fb0e](https://github.com/apache/airflow/commit/f3521fb0e36733d8bd356123e56a453fd37a6dca) | 2020-05-16 | Regenerate readme files for backport package release (#8886) | -| [92585ca4c](https://github.com/apache/airflow/commit/92585ca4cb375ac879f4ab331b3a063106eb7b92) | 2020-05-15 | Added automated release notes generation for backport operators (#8807) | -| [4bde99f13](https://github.com/apache/airflow/commit/4bde99f1323d72f6c84c1548079d5e98fc0a2a9a) | 2020-03-23 | Make airflow/providers pylint compatible (#7802) | -| [97a429f9d](https://github.com/apache/airflow/commit/97a429f9d0cf740c5698060ad55f11e93cb57b55) | 2020-02-02 | [AIRFLOW-6714] Remove magic comments about UTF-8 (#7338) | -| [9a04013b0](https://github.com/apache/airflow/commit/9a04013b0e40b0d744ff4ac9f008491806d60df2) | 2020-01-27 | [AIRFLOW-6646][AIP-21] Move protocols classes to providers package (#7268) | diff --git a/airflow/providers/email/__init__.py b/airflow/providers/email/__init__.py deleted file mode 100644 index 217e5db960782..0000000000000 --- a/airflow/providers/email/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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. diff --git a/airflow/providers/email/operators/__init__.py b/airflow/providers/email/operators/__init__.py deleted file mode 100644 index 217e5db960782..0000000000000 --- a/airflow/providers/email/operators/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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. diff --git a/docs/autoapi_templates/index.rst b/docs/autoapi_templates/index.rst index a04c53edc1260..a1263861c25e5 100644 --- a/docs/autoapi_templates/index.rst +++ b/docs/autoapi_templates/index.rst @@ -114,8 +114,6 @@ All operators are in the following packages: airflow/providers/docker/operators/index - airflow/providers/email/operators/index - airflow/providers/exasol/operators/index airflow/providers/ftp/sensors/index diff --git a/docs/concepts.rst b/docs/concepts.rst index 8f5644bc14f03..3d2bc891b2b33 100644 --- a/docs/concepts.rst +++ b/docs/concepts.rst @@ -380,7 +380,7 @@ Airflow provides operators for many common tasks, including: - :class:`~airflow.operators.bash.BashOperator` - executes a bash command - :class:`~airflow.operators.python.PythonOperator` - calls an arbitrary Python function -- :class:`~airflow.providers.email.operators.email.EmailOperator` - sends an email +- :class:`~airflow.operators.email.EmailOperator` - sends an email - :class:`~airflow.providers.http.operators.http.SimpleHttpOperator` - sends an HTTP request - :class:`~airflow.providers.mysql.operators.mysql.MySqlOperator`, :class:`~airflow.providers.sqlite.operators.sqlite.SqliteOperator`, diff --git a/docs/operators-and-hooks-ref.rst b/docs/operators-and-hooks-ref.rst index 17ed2beea94eb..b587ca4545d6a 100644 --- a/docs/operators-and-hooks-ref.rst +++ b/docs/operators-and-hooks-ref.rst @@ -57,12 +57,16 @@ Fundamentals * - :mod:`airflow.operators.branch_operator` - + * - :mod:`airflow.operators.dagrun_operator` - * - :mod:`airflow.operators.dummy_operator` - + * - :mod:`airflow.operators.email` + - + * - :mod:`airflow.operators.generic_transfer` - @@ -1598,12 +1602,6 @@ communication protocols or interface. - :mod:`airflow.providers.ssh.operators.ssh` - - * - `Simple Mail Transfer Protocol (SMTP) `__ - - - - - - :mod:`airflow.providers.email.operators.email` - - - * - `Windows Remote Management (WinRM) `__ - - :mod:`airflow.providers.microsoft.winrm.hooks.winrm` diff --git a/setup.py b/setup.py index 8a7ae16606e11..99ad1869e74fa 100644 --- a/setup.py +++ b/setup.py @@ -510,7 +510,6 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version "discord": [], "docker": docker, "elasticsearch": [], - "email": [], "exasol": exasol, "facebook": facebook, "ftp": [], diff --git a/tests/deprecated_classes.py b/tests/deprecated_classes.py index 4545fedbf8d4a..2d53951c2a2b3 100644 --- a/tests/deprecated_classes.py +++ b/tests/deprecated_classes.py @@ -1268,7 +1268,7 @@ 'airflow.contrib.operators.winrm_operator.WinRMOperator', ), ( - 'airflow.providers.email.operators.email.EmailOperator', + 'airflow.operators.email.EmailOperator', 'airflow.operators.email_operator.EmailOperator', ), ( diff --git a/tests/providers/email/operators/test_email.py b/tests/operators/test_email.py similarity index 92% rename from tests/providers/email/operators/test_email.py rename to tests/operators/test_email.py index f4e7641db7605..867c1116a9370 100644 --- a/tests/providers/email/operators/test_email.py +++ b/tests/operators/test_email.py @@ -21,7 +21,7 @@ from unittest import mock from airflow.models.dag import DAG -from airflow.providers.email.operators.email import EmailOperator +from airflow.operators.email import EmailOperator from airflow.utils import timezone from tests.test_utils.config import conf_vars @@ -57,7 +57,7 @@ def _run_as_operator(self, **kwargs): def test_execute(self): with conf_vars( - {('email', 'email_backend'): 'tests.providers.email.operators.test_email.send_email_test'} + {('email', 'email_backend'): 'tests.operators.test_email.send_email_test'} ): self._run_as_operator() assert send_email_test.call_count == 1