Adds predefined providers to install_requires. (#12916)

* The 4 providers (http, ftp, sqlite, imap) are popular
and they do not require any additionl dependencies so we decided
to include them by default in Airflow 2.0

Co-authored-by: Jarek Potiuk <jarek.potiuk@polidea.com>

* Update setup.py

Co-authored-by: Jarek Potiuk <jarek.potiuk@polidea.com>
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
This commit is contained in:
Ash Berlin-Taylor 2020-12-08 15:22:47 +00:00 коммит произвёл GitHub
Родитель 9b39f24780
Коммит e7c1771cba
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 22 добавлений и 1 удалений

Просмотреть файл

@ -80,6 +80,10 @@ setup_requires =
#####################################################################################################
install_requires =
alembic>=1.2, <2.0
apache-airflow-providers-ftp
apache-airflow-providers-http
apache-airflow-providers-imap
apache-airflow-providers-sqlite
argcomplete~=1.10
attrs>=20.0, <21.0
cached_property~=1.5

Просмотреть файл

@ -26,7 +26,7 @@ from os.path import dirname
from textwrap import wrap
from typing import Dict, Iterable, List
from setuptools import Command, find_namespace_packages, setup
from setuptools import Command, Distribution, find_namespace_packages, setup
logger = logging.getLogger(__name__)
@ -884,6 +884,22 @@ EXTRAS_REQUIREMENTS.update(
)
class AirflowDistribtuion(Distribution):
"""setuptools.Distribution subclass with Airflow specific behaviour"""
# https://github.com/PyCQA/pylint/issues/3737
def parse_config_files(self, *args, **kwargs): # pylint: disable=signature-differs
"""
Ensure that when we have been asked to install providers from sources
that we don't *also* try to install those providers from PyPI
"""
super().parse_config_files(*args, **kwargs)
if os.getenv('INSTALL_PROVIDERS_FROM_SOURCES') == 'true':
self.install_requires = [ # pylint: disable=attribute-defined-outside-init
req for req in self.install_requires if not req.startswith('apache-airflow-providers-')
]
def get_provider_package_from_package_id(package_id: str):
"""
Builds the name of provider package out of the package id provided/
@ -911,6 +927,7 @@ def do_setup():
write_version()
setup(
distclass=AirflowDistribtuion,
# Most values come from setup.cfg -- see
# https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html
version=version,