forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of requests as core dependency (apache#15781)
This change gets rid of requests as core dependency. We have to change requests to become an optional dependency because it (so far) pulls in chardet as dependency and chardet is LGPL, which is not allowed to be mandatory dependency by ASF policies. More info here: https://issues.apache.org/jira/browse/LEGAL-572 The changes: * connexion is vendored-in (and requests usage is replaced with httpx) * Http Provider is turned into optional provider (not preinstalled) * Few places where requests were used in core and in cloud_sql provider which did not cause compatibility problem, it was replaced by httpx. * new extra added for deprecated experimental API (which is disabled by default and optional) * tests are fixed (using pytest-httpx fixture package) * The providers: http, airbyte, apache.livy, opsgenie, slack (all depend on http) now explicitely depend on `requirements`.
- Loading branch information
Showing
68 changed files
with
6,468 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import sys | ||
|
||
import werkzeug.exceptions as exceptions # NOQA | ||
|
||
from .apis import AbstractAPI # NOQA | ||
from .apps import AbstractApp # NOQA | ||
from .decorators.produces import NoContent # NOQA | ||
from .exceptions import ProblemException # NOQA | ||
# add operation for backwards compatability | ||
from .operations import compat | ||
from .problem import problem # NOQA | ||
from .resolver import Resolution, Resolver, RestyResolver # NOQA | ||
|
||
full_name = '{}.operation'.format(__package__) | ||
sys.modules[full_name] = sys.modules[compat.__name__] | ||
|
||
|
||
def not_installed_error(exc): # pragma: no cover | ||
import functools | ||
|
||
def _required_lib(exc, *args, **kwargs): | ||
raise exc | ||
|
||
return functools.partial(_required_lib, exc) | ||
|
||
|
||
try: | ||
from .apis.flask_api import FlaskApi, context # NOQA | ||
from .apps.flask_app import FlaskApp | ||
from flask import request # NOQA | ||
except ImportError as e: # pragma: no cover | ||
_flask_not_installed_error = not_installed_error(e) | ||
FlaskApi = _flask_not_installed_error | ||
FlaskApp = _flask_not_installed_error | ||
|
||
App = FlaskApp | ||
Api = FlaskApi | ||
|
||
try: | ||
from .apis.aiohttp_api import AioHttpApi | ||
from .apps.aiohttp_app import AioHttpApp | ||
except ImportError as e: # pragma: no cover | ||
_aiohttp_not_installed_error = not_installed_error(e) | ||
AioHttpApi = _aiohttp_not_installed_error | ||
AioHttpApp = _aiohttp_not_installed_error | ||
|
||
# This version is replaced during release process. | ||
__version__ = '2.7.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from airflow._vendor.connexion.cli import main # pragma: no cover | ||
|
||
main() # pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .abstract import AbstractAPI # NOQA |
Oops, something went wrong.