From bbfa903723a3374f4e18985d3ae74a380fdb559a Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 7 Jul 2020 10:02:50 -0400 Subject: [PATCH 1/3] Fix for isort v5.0.0 --- .isort.cfg | 3 --- medallion/__init__.py | 5 +---- tox.ini | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 437fb830..44600794 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,8 +1,5 @@ [settings] -check=1 -diff=1 known_third_party=bson,flask,flask_httpauth,jwt,pymongo,pytest,pytz,six,werkzeug known_first_party=medallion -not_skip=__init__.py force_sort_within_sections=1 multi_line_output=5 diff --git a/medallion/__init__.py b/medallion/__init__.py index 7dffd894..e7fba275 100644 --- a/medallion/__init__.py +++ b/medallion/__init__.py @@ -80,10 +80,7 @@ def connect_to_backend(config_info): def register_blueprints(flask_application_instance): - from medallion.views import collections - from medallion.views import discovery - from medallion.views import manifest - from medallion.views import objects + from medallion.views import collections, discovery, manifest, objects with flask_application_instance.app_context(): log.debug("Registering medallion blueprints into {}".format(current_app)) diff --git a/tox.ini b/tox.ini index 7d97bf11..cabc9ac9 100644 --- a/tox.ini +++ b/tox.ini @@ -31,8 +31,8 @@ max-line-length=160 [testenv:isort-check] deps = isort commands = - isort -rc medallion -df - isort -rc medallion -c + isort medallion --df + isort medallion -c [testenv:packaging] deps = From eb7e1787d52b337fd9fdb9bc60105de87057599f Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 7 Jul 2020 10:06:29 -0400 Subject: [PATCH 2/3] Tweak tox config Only need to run flake8 on one python version. --- tox.ini | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index cabc9ac9..4c067d79 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,py36,py37,py38,pycodestyle,isort-check,packaging +envlist = py35,py36,py37,py38,style,isort-check,packaging [testenv] deps = @@ -16,13 +16,13 @@ commands = passenv = CI TRAVIS TRAVIS_* -[testenv:pycodestyle] +[testenv:style] deps = flake8 commands = flake8 -[pycodestyle] +[style] max-line-length=160 [flake8] @@ -42,7 +42,7 @@ commands = [travis] python = - 3.5: py35, pycodestyle - 3.6: py36, pycodestyle, isort-check, packaging - 3.7: py37, pycodestyle - 3.8: py38, pycodestyle + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38, style, isort-check, packaging From 48312ceb8d17749279ac2fffefdc198e0190c87f Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 7 Jul 2020 10:16:58 -0400 Subject: [PATCH 3/3] Fix typo --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4c067d79..96725362 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ deps = commands = flake8 -[style] +[pycodestyle] max-line-length=160 [flake8]