mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 12:27:45 +00:00
Upgrade isort==5.9.1 (#1388)
* Upgrade isort==5.9.1 * isort --thirdparty connexion,aiohttp ./tests * isort --thirdparty aiohttp,connexion --check-only --diff . * cd tests before running isort
This commit is contained in:
@@ -11,7 +11,6 @@ from ..http_facts import FORM_CONTENT_TYPES
|
|||||||
from ..lifecycle import ConnexionRequest # NOQA
|
from ..lifecycle import ConnexionRequest # NOQA
|
||||||
from ..utils import all_json
|
from ..utils import all_json
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from openapi_spec_validator.handlers import UrlHandler
|
|||||||
|
|
||||||
from .utils import deep_get
|
from .utils import deep_get
|
||||||
|
|
||||||
|
|
||||||
default_handlers = {
|
default_handlers = {
|
||||||
'http': UrlHandler('http'),
|
'http': UrlHandler('http'),
|
||||||
'https': UrlHandler('https'),
|
'https': UrlHandler('https'),
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from .json_schema import resolve_refs
|
|||||||
from .operations import OpenAPIOperation, Swagger2Operation
|
from .operations import OpenAPIOperation, Swagger2Operation
|
||||||
from .utils import deep_get
|
from .utils import deep_get
|
||||||
|
|
||||||
|
|
||||||
NO_SPEC_VERSION_ERR_MSG = """Unable to get the spec version.
|
NO_SPEC_VERSION_ERR_MSG = """Unable to get the spec version.
|
||||||
You are missing either '"swagger": "2.0"' or '"openapi": "3.0.0"'
|
You are missing either '"swagger": "2.0"' or '"openapi": "3.0.0"'
|
||||||
from the top level of your spec."""
|
from the top level of your spec."""
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from aiohttp import web
|
|
||||||
import connexion
|
import connexion
|
||||||
|
from aiohttp import web
|
||||||
|
|
||||||
|
|
||||||
async def post_greeting(name):
|
async def post_greeting(name):
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ Basic example of a resource server
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
from werkzeug.exceptions import Unauthorized
|
|
||||||
|
|
||||||
from jose import JWTError, jwt
|
from jose import JWTError, jwt
|
||||||
|
from werkzeug.exceptions import Unauthorized
|
||||||
|
|
||||||
JWT_ISSUER = 'com.zalando.connexion'
|
JWT_ISSUER = 'com.zalando.connexion'
|
||||||
JWT_SECRET = 'change_this'
|
JWT_SECRET = 'change_this'
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from aiohttp_remotes.exceptions import RemoteError, TooManyHeaders
|
from aiohttp_remotes.exceptions import RemoteError, TooManyHeaders
|
||||||
from aiohttp_remotes.x_forwarded import XForwardedBase
|
from aiohttp_remotes.x_forwarded import XForwardedBase
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ import datetime
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
from connexion import NoContent
|
|
||||||
|
|
||||||
import orm
|
import orm
|
||||||
|
from connexion import NoContent
|
||||||
|
|
||||||
db_session = None
|
db_session = None
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ import datetime
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
from connexion import NoContent
|
|
||||||
|
|
||||||
import orm
|
import orm
|
||||||
|
from connexion import NoContent
|
||||||
|
|
||||||
db_session = None
|
db_session = None
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
import aiohttp.test_utils
|
|
||||||
import pytest
|
import pytest
|
||||||
from connexion import AioHttpApp
|
from connexion import AioHttpApp
|
||||||
from connexion.apis.aiohttp_api import HTTPStatus
|
from connexion.apis.aiohttp_api import HTTPStatus
|
||||||
|
|
||||||
|
import aiohttp.test_utils
|
||||||
|
|
||||||
|
|
||||||
def is_valid_problem_json(json_body):
|
def is_valid_problem_json(json_body):
|
||||||
return all(key in json_body for key in ["type", "title", "detail", "status"])
|
return all(key in json_body for key in ["type", "title", "detail", "status"])
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from aiohttp import web
|
|
||||||
from aiohttp_remotes.exceptions import RemoteError, TooManyHeaders
|
from aiohttp_remotes.exceptions import RemoteError, TooManyHeaders
|
||||||
from aiohttp_remotes.x_forwarded import XForwardedBase
|
from aiohttp_remotes.x_forwarded import XForwardedBase
|
||||||
from connexion import AioHttpApp
|
from connexion import AioHttpApp
|
||||||
from yarl import URL
|
from yarl import URL
|
||||||
|
|
||||||
|
from aiohttp import web
|
||||||
|
|
||||||
X_FORWARDED_PATH = "X-Forwarded-Path"
|
X_FORWARDED_PATH = "X-Forwarded-Path"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from aiohttp import web
|
|
||||||
from connexion.apis.aiohttp_api import AioHttpApi
|
from connexion.apis.aiohttp_api import AioHttpApi
|
||||||
from connexion.lifecycle import ConnexionResponse
|
from connexion.lifecycle import ConnexionResponse
|
||||||
|
|
||||||
|
from aiohttp import web
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='module')
|
@pytest.fixture(scope='module')
|
||||||
def api(aiohttp_api_spec_dir):
|
def api(aiohttp_api_spec_dir):
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ import json
|
|||||||
from struct import unpack
|
from struct import unpack
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from werkzeug.test import Client, EnvironBuilder
|
|
||||||
|
|
||||||
from connexion.apps.flask_app import FlaskJSONEncoder
|
from connexion.apps.flask_app import FlaskJSONEncoder
|
||||||
|
from werkzeug.test import Client, EnvironBuilder
|
||||||
|
|
||||||
|
|
||||||
def test_app(simple_app):
|
def test_app(simple_app):
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
import json
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
import json
|
|
||||||
import pytest
|
import pytest
|
||||||
import requests
|
import requests
|
||||||
from connexion.exceptions import OAuthProblem, OAuthResponseProblem, OAuthScopeProblem
|
from connexion.exceptions import (OAuthProblem, OAuthResponseProblem,
|
||||||
|
OAuthScopeProblem)
|
||||||
|
|
||||||
|
|
||||||
def test_get_tokeninfo_url(monkeypatch, security_handler_factory):
|
def test_get_tokeninfo_url(monkeypatch, security_handler_factory):
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from connexion.lifecycle import ConnexionResponse
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from aiohttp.web import Request
|
from aiohttp.web import Request
|
||||||
from aiohttp.web import Response as AioHttpResponse
|
from aiohttp.web import Response as AioHttpResponse
|
||||||
from connexion.lifecycle import ConnexionResponse
|
|
||||||
|
|
||||||
|
|
||||||
async def get_bye(name):
|
async def get_bye(name):
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from flask import jsonify, redirect
|
|
||||||
|
|
||||||
from connexion import NoContent, ProblemException, context, request
|
from connexion import NoContent, ProblemException, context, request
|
||||||
|
from flask import jsonify, redirect
|
||||||
|
|
||||||
|
|
||||||
class DummyClass:
|
class DummyClass:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import pathlib
|
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import tempfile
|
import tempfile
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from flask import Flask
|
|
||||||
|
|
||||||
from connexion.apis.flask_api import FlaskApi
|
from connexion.apis.flask_api import FlaskApi
|
||||||
from connexion.apps.flask_app import FlaskApp
|
from connexion.apps.flask_app import FlaskApp
|
||||||
|
from flask import Flask
|
||||||
|
|
||||||
|
|
||||||
def test_flask_app_default_params():
|
def test_flask_app_default_params():
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import pytest
|
|
||||||
import connexion.apps
|
import connexion.apps
|
||||||
|
import pytest
|
||||||
from connexion.exceptions import ResolverError
|
from connexion.exceptions import ResolverError
|
||||||
from connexion.operations import Swagger2Operation
|
from connexion.operations import Swagger2Operation
|
||||||
from connexion.resolver import Resolver, RestyResolver
|
from connexion.resolver import Resolver, RestyResolver
|
||||||
|
|||||||
16
tox.ini
16
tox.ini
@@ -16,9 +16,9 @@ envlist =
|
|||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.6: py36-min,py36-pypi
|
3.6: py36-min,py36-pypi
|
||||||
3.7: py37-min,py37-pypi,flake8
|
3.7: py37-min,py37-pypi
|
||||||
3.8: py38-min,py38-pypi
|
3.8: py38-min,py38-pypi
|
||||||
3.9: py39-min,py39-pypi,isort-check,isort-check-examples,isort-check-tests
|
3.9: py39-min,py39-pypi,flake8,isort-check,isort-check-examples,isort-check-tests
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv=PYTHONPATH = {toxinidir}:{toxinidir}
|
setenv=PYTHONPATH = {toxinidir}:{toxinidir}
|
||||||
@@ -41,18 +41,18 @@ commands=python setup.py flake8
|
|||||||
|
|
||||||
[testenv:isort-check]
|
[testenv:isort-check]
|
||||||
basepython=python3
|
basepython=python3
|
||||||
deps=isort==4.3.15
|
deps=isort==5.9.1
|
||||||
changedir={toxinidir}/connexion
|
changedir={toxinidir}/connexion
|
||||||
commands=isort -p connexion -c -diff .
|
commands=isort --project connexion --check-only --diff .
|
||||||
|
|
||||||
[testenv:isort-check-examples]
|
[testenv:isort-check-examples]
|
||||||
basepython=python3
|
basepython=python3
|
||||||
deps=isort==4.3.15
|
deps=isort==5.9.1
|
||||||
changedir={toxinidir}/examples
|
changedir={toxinidir}/examples
|
||||||
commands=isort -o connexion -c -diff .
|
commands=isort --thirdparty connexion --check-only --diff .
|
||||||
|
|
||||||
[testenv:isort-check-tests]
|
[testenv:isort-check-tests]
|
||||||
basepython=python3
|
basepython=python3
|
||||||
deps=isort==4.3.15
|
deps=isort==5.9.1
|
||||||
changedir={toxinidir}/tests
|
changedir={toxinidir}/tests
|
||||||
commands=isort -o connexion -c -diff .
|
commands=isort --thirdparty aiohttp,connexion --check-only --diff .
|
||||||
|
|||||||
Reference in New Issue
Block a user