Skip to content

Commit

Permalink
bump and pin isort, apply all automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtkav committed Mar 15, 2019
1 parent 0989a93 commit 0c3dc26
Show file tree
Hide file tree
Showing 29 changed files with 52 additions and 41 deletions.
13 changes: 7 additions & 6 deletions connexion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import sys

import werkzeug.exceptions as exceptions # NOQA
from .apps import AbstractApp # 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 .decorators.produces import NoContent # NOQA
from .resolver import Resolution, Resolver, RestyResolver # NOQA

import sys

# add operation for backwards compatability
from .operations import compat
full_name = '{}.operation'.format(__package__)
sys.modules[full_name] = sys.modules[compat.__name__]

Expand Down
4 changes: 2 additions & 2 deletions connexion/apis/aiohttp_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import re
from urllib.parse import parse_qs

import jinja2

import aiohttp_jinja2
import jinja2
from aiohttp import web
from aiohttp.web_exceptions import HTTPNotFound

from connexion.apis.abstract import AbstractAPI
from connexion.exceptions import OAuthProblem, OAuthScopeProblem
from connexion.handlers import AuthErrorHandler
Expand Down
2 changes: 1 addition & 1 deletion connexion/operations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .abstract import AbstractOperation # noqa
from .openapi import OpenAPIOperation # noqa
from .swagger2 import Swagger2Operation # noqa
from .secure import SecureOperation # noqa
from .swagger2 import Swagger2Operation # noqa


def make_operation(spec, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion examples/openapi3/jwt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import time

import connexion
import six
from werkzeug.exceptions import Unauthorized

import connexion
from jose import JWTError, jwt

JWT_ISSUER = 'com.zalando.connexion'
Expand Down
3 changes: 2 additions & 1 deletion examples/openapi3/methodresolver/api/petsview.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import datetime

from connexion import NoContent
from flask import request
from flask.views import MethodView

from connexion import NoContent


class PetsView(MethodView):
""" Create Pets service
Expand Down
3 changes: 1 addition & 2 deletions examples/openapi3/sqlalchemy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import logging

import connexion
from connexion import NoContent

import orm
from connexion import NoContent

db_session = None

Expand Down
3 changes: 2 additions & 1 deletion examples/swagger2/enforcedefaults/enforcedefaults.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3

import connexion
import jsonschema
import six

import connexion
from connexion.decorators.validation import RequestBodyValidator
from connexion.json_schema import Draft4RequestValidator

Expand Down
3 changes: 1 addition & 2 deletions examples/swagger2/sqlalchemy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import logging

import connexion
from connexion import NoContent

import orm
from connexion import NoContent

db_session = None

Expand Down
1 change: 1 addition & 0 deletions tests/aiohttp/test_aiohttp_api_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import base64

import ujson

from conftest import TEST_FOLDER
from connexion import AioHttpApp

Expand Down
1 change: 1 addition & 0 deletions tests/aiohttp/test_aiohttp_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest import mock

import pytest

from conftest import TEST_FOLDER
from connexion import AioHttpApp
from connexion.exceptions import ConnexionException
Expand Down
4 changes: 2 additions & 2 deletions tests/aiohttp/test_aiohttp_simple_api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
import sys

import yaml

import aiohttp.web
import pytest
import yaml

from conftest import TEST_FOLDER
from connexion import AioHttpApp

Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json

import jinja2
import mock
import pytest
import yaml
from openapi_spec_validator.loaders import ExtendedSafeLoader

import mock
import pytest
from conftest import TEST_FOLDER, build_app_from_fixture
from connexion import App
from connexion.exceptions import InvalidSpecification
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys

import pytest

from connexion import App

logging.basicConfig(level=logging.DEBUG)
Expand Down
3 changes: 2 additions & 1 deletion tests/decorators/test_parameter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from connexion.decorators.parameter import parameter_to_arg
# we are using "mock" module here for Py 2.7 support
from mock import MagicMock

from connexion.decorators.parameter import parameter_to_arg


def test_injection():
request = MagicMock(name='request', path_params={'p1': '123'})
Expand Down
4 changes: 2 additions & 2 deletions tests/decorators/test_security.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json

import pytest
import requests
from mock import MagicMock

import pytest
from connexion.decorators.security import (get_tokeninfo_func,
get_tokeninfo_remote,
validate_scope, verify_apikey,
verify_basic, verify_oauth)
from connexion.exceptions import (OAuthProblem, OAuthResponseProblem,
OAuthScopeProblem)
from mock import MagicMock


def test_get_tokeninfo_url(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion tests/decorators/test_uri_parsing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from werkzeug.datastructures import MultiDict

import pytest
from connexion.decorators.uri_parsing import (AlwaysMultiURIParser,
FirstValueURIParser,
Swagger2URIParser)
Expand Down
4 changes: 2 additions & 2 deletions tests/decorators/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
from jsonschema import ValidationError
from mock import MagicMock

import pytest
from connexion.decorators.validation import ParameterValidator
from connexion.json_schema import (Draft4RequestValidator,
Draft4ResponseValidator)
from mock import MagicMock


def test_get_valid_parameter():
Expand Down
1 change: 1 addition & 0 deletions tests/fakeapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .example_method_view import Example_methodView


def get():
return ''
1 change: 1 addition & 0 deletions tests/fakeapi/aiohttp_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import aiohttp
from aiohttp.web import Request
from aiohttp.web import Response as AioHttpResponse

from connexion.lifecycle import ConnexionResponse


Expand Down
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import pathlib
import tempfile

import pytest
from mock import MagicMock
from yaml import YAMLError

import pytest
from connexion import FlaskApi
from connexion.exceptions import InvalidSpecification, ResolverError
from connexion.spec import canonical_base_path
from mock import MagicMock

TEST_FOLDER = pathlib.Path(__file__).parent

Expand Down
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import logging

import pytest
from click.testing import CliRunner
from mock import MagicMock
from mock import call as mock_call

import connexion
import pytest
from conftest import FIXTURES_FOLDER
from connexion.cli import main
from connexion.exceptions import ResolverError
from mock import MagicMock
from mock import call as mock_call


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json_validation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json

import pytest
from jsonschema.validators import _utils, extend

import pytest
from conftest import build_app_from_fixture
from connexion import App
from connexion.decorators.validation import RequestBodyValidator
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metrics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json

import flask
from mock import MagicMock

import connexion
from connexion.decorators.metrics import UWSGIMetricsCollector
from mock import MagicMock


def test_timer(monkeypatch):
Expand Down
1 change: 1 addition & 0 deletions tests/test_operation2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import mock
import pytest

from connexion.apis.flask_api import Jsonifier
from connexion.decorators.security import (get_tokeninfo_remote,
validate_scope, verify_security)
Expand Down
1 change: 1 addition & 0 deletions tests/test_references.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import mock
import pytest

from connexion.apis.flask_api import Jsonifier
from connexion.json_schema import RefResolutionError, resolve_refs

Expand Down
3 changes: 2 additions & 1 deletion tests/test_resolver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import connexion.apps
import pytest

import connexion.apps
from connexion.exceptions import ResolverError
from connexion.operations import Swagger2Operation
from connexion.resolver import Resolver, RestyResolver
Expand Down
5 changes: 3 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import math

import connexion.apps
import pytest
from connexion import utils
from mock import MagicMock

import connexion.apps
from connexion import utils


def test_get_function_from_name():
function = utils.get_function_from_name('math.ceil')
Expand Down
4 changes: 2 additions & 2 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json

import flask
# we are using "mock" module here for Py 2.7 support
from mock import MagicMock

from connexion.apis.flask_api import FlaskApi
from connexion.decorators.validation import ParameterValidator
# we are using "mock" module here for Py 2.7 support
from mock import MagicMock


def test_parameter_validator(monkeypatch):
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ commands=python setup.py flake8

[testenv:isort-check]
basepython=python3
deps=isort
deps=isort==4.3.15
changedir={toxinidir}/connexion
commands=isort -ns __init__.py -rc -c -df .

[testenv:isort-check-examples]
basepython=python3
deps=isort
deps=isort==4.3.15
changedir={toxinidir}/examples
commands=isort -ns __init__.py -o connexion -rc -c -df .

[testenv:isort-check-tests]
basepython=python3
deps=isort
deps=isort==4.3.15
changedir={toxinidir}/tests
commands=isort -ns __init__.py -p connexion -rc -c -df .

0 comments on commit 0c3dc26

Please sign in to comment.