Skip to content

Commit

Permalink
Fixed imports formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
akornatskyy committed Oct 11, 2020
1 parent 45f8157 commit 07f063d
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 24 deletions.
5 changes: 3 additions & 2 deletions demos/ajax/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

import unittest

from app import main

from wheezy.core.comp import json_dumps

from wheezy.http.functional import WSGIClient


Expand All @@ -14,6 +13,8 @@ class WelcomeTestCase(unittest.TestCase):
d = {"name": ["John"]}

def setUp(self):
from app import main

self.client = WSGIClient(main)

def tearDown(self):
Expand Down
1 change: 1 addition & 0 deletions demos/guestbook/guestbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from wheezy.caching.memory import MemoryCache
from wheezy.caching.patterns import CacheDependency
from wheezy.core.collections import last_item_adapter

from wheezy.http import (
CacheProfile,
HTTPResponse,
Expand Down
4 changes: 2 additions & 2 deletions demos/hello/benchmark_helloworld.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
""" ``benchmark_hello`` module.
"""

from test_helloworld import HelloWorldTestCase

from wheezy.core.benchmark import Benchmark

from test_helloworld import HelloWorldTestCase


class BenchmarkTestCase(HelloWorldTestCase):
""""""
Expand Down
4 changes: 2 additions & 2 deletions demos/hello/test_helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import unittest

from helloworld import main

from wheezy.http.functional import WSGIClient


class HelloWorldTestCase(unittest.TestCase):
def setUp(self):
from helloworld import main

self.client = WSGIClient(main)

def tearDown(self):
Expand Down
1 change: 1 addition & 0 deletions demos/oauth2/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from wheezy.core.comp import json_loads, urlencode
from wheezy.core.httpclient import HTTPClient
from wheezy.core.uuid import shrink_uuid

from wheezy.http import (
HTTPResponse,
WSGIApplication,
Expand Down
1 change: 1 addition & 0 deletions demos/wsgi_adapter/wsgi_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datetime import datetime, timedelta

from wheezy.caching import MemoryCache

from wheezy.http import CacheProfile, WSGIApplication, bootstrap_http_defaults
from wheezy.http.cache import etag_md5crc32, wsgi_cache
from wheezy.http.comp import b
Expand Down
10 changes: 5 additions & 5 deletions requirements/dev-py2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# pip-compile --output-file=requirements/dev-py2.txt requirements/dev.in
#
atomicwrites==1.4.0 # via pytest
attrs==20.1.0 # via pytest
attrs==20.2.0 # via pytest
backports.functools-lru-cache==1.6.1 # via wcwidth
click==7.1.2 # via pip-tools
colorama==0.4.3 # via pytest
configparser==4.0.2 # via importlib-metadata
contextlib2==0.6.0.post1 # via importlib-metadata
coverage==5.2.1 # via pytest-cov
coverage==5.3 # via pytest-cov
funcsigs==1.0.2 # via mock, pytest
importlib-metadata==1.7.0 # via pluggy, pytest
importlib-metadata==2.0.0 # via pluggy, pytest
lxml==4.5.2 # via -r requirements/dev.in
mock==3.0.5 # via -r requirements/dev.in
more-itertools==5.0.0 # via pytest
Expand All @@ -28,8 +28,8 @@ pytest==4.6.11 # via -r requirements/dev.in, pytest-cov
scandir==1.10.0 # via pathlib2
six==1.15.0 # via mock, more-itertools, packaging, pathlib2, pip-tools, pytest
wcwidth==0.2.5 # via pytest
wheezy.caching==0.1.131 # via -r requirements/dev.in
wheezy.core==0.1.153 # via -r requirements/dev.in
wheezy.caching==0.1.133 # via -r requirements/dev.in
wheezy.core==0.1.156 # via -r requirements/dev.in
zipp==1.2.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
11 changes: 5 additions & 6 deletions requirements/dev-py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@
# pip-compile --output-file=requirements/dev-py3.txt requirements/dev.in
#
atomicwrites==1.4.0 # via pytest
attrs==20.1.0 # via pytest
attrs==20.2.0 # via pytest
click==7.1.2 # via pip-tools
colorama==0.4.3 # via pytest
coverage==5.2.1 # via pytest-cov
coverage==5.3 # via pytest-cov
iniconfig==1.0.1 # via pytest
lxml==4.5.2; platform_system != 'Windows' # via -r requirements/dev.in
mock==4.0.2 # via -r requirements/dev.in
more-itertools==8.5.0 # via pytest
packaging==20.4 # via pytest
pip-tools==5.3.1 # via -r requirements/dev.in
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest
pyparsing==2.4.7 # via packaging
pytest-cov==2.10.1 # via -r requirements/dev.in
pytest==6.0.1 # via -r requirements/dev.in, pytest-cov
pytest==6.1.1 # via -r requirements/dev.in, pytest-cov
six==1.15.0 # via packaging, pip-tools
toml==0.10.1 # via pytest
wheezy.caching==0.1.131 # via -r requirements/dev.in
wheezy.core==0.1.153 # via -r requirements/dev.in
wheezy.caching==0.1.133 # via -r requirements/dev.in
wheezy.core==0.1.156 # via -r requirements/dev.in

# The following packages are considered to be unsafe in a requirements file:
# pip
4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ imagesize==1.2.0 # via sphinx
jinja2==2.11.2 # via sphinx
markupsafe==1.1.1 # via jinja2
packaging==20.4 # via sphinx
pygments==2.6.1 # via sphinx
pygments==2.7.1 # via sphinx
pyparsing==2.4.7 # via packaging
pytz==2020.1 # via babel
requests==2.24.0 # via sphinx
Expand All @@ -30,7 +30,7 @@ sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.4 # via sphinx
urllib3==1.25.10 # via requests
wheezy.core==0.1.153 # via -r requirements/docs.in
wheezy.core==0.1.156 # via -r requirements/docs.in

# The following packages are considered to be unsafe in a requirements file:
# setuptools
1 change: 1 addition & 0 deletions src/wheezy/http/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""

from wheezy.core.url import UrlParts

from wheezy.http.response import permanent_redirect


Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/cacheprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from time import time

from wheezy.core.datetime import format_http_datetime, total_seconds

from wheezy.http.cachepolicy import HTTPCachePolicy

CACHEABILITY = {
Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from time import time

from wheezy.core.datetime import format_http_datetime

from wheezy.http.comp import n


Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from wheezy.core.benchmark import Benchmark, Timer
from wheezy.core.collections import attrdict, defaultdict
from wheezy.core.comp import json_loads, urlsplit

from wheezy.http.comp import ( # noqa: I101
PY3,
BytesIO,
Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""

from wheezy.core.datetime import parse_http_datetime

from wheezy.http.cache import (
CacheableResponse,
NotModifiedResponse,
Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from wheezy.core.comp import json_loads
from wheezy.core.descriptors import attribute
from wheezy.core.url import UrlParts

from wheezy.http.comp import bton
from wheezy.http.parse import parse_cookie, parse_multipart, parse_qs

Expand Down
2 changes: 2 additions & 0 deletions src/wheezy/http/tests/test_cachepolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def test_expires(self):
from datetime import datetime

from wheezy.core.datetime import UTC

from wheezy.http.cachepolicy import HTTPCachePolicy

when = datetime(2012, 4, 13, 14, 57, tzinfo=UTC)
Expand All @@ -289,6 +290,7 @@ def test_last_modified(self):
from datetime import datetime

from wheezy.core.datetime import UTC

from wheezy.http.cachepolicy import HTTPCachePolicy

when = datetime(2012, 4, 13, 15, 2, tzinfo=UTC)
Expand Down
3 changes: 3 additions & 0 deletions src/wheezy/http/tests/test_cacheprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def test_location_client(self):
from datetime import datetime, timedelta

from wheezy.core.datetime import parse_http_datetime

from wheezy.http.cacheprofile import CacheProfile

profile = CacheProfile("client", duration=100)
Expand All @@ -139,6 +140,7 @@ def test_location_both(self):
from datetime import datetime, timedelta

from wheezy.core.datetime import parse_http_datetime

from wheezy.http.cacheprofile import CacheProfile

profile = CacheProfile("both", duration=100, http_vary=["Cookie"])
Expand All @@ -165,6 +167,7 @@ def test_location_public(self):
from datetime import datetime, timedelta

from wheezy.core.datetime import parse_http_datetime

from wheezy.http.cacheprofile import CacheProfile

profile = CacheProfile("public", duration=100)
Expand Down
1 change: 1 addition & 0 deletions src/wheezy/http/tests/test_cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_max_age(self):
from datetime import datetime, timedelta

from wheezy.core.datetime import parse_http_datetime

from wheezy.http.cookie import HTTPCookie

cookie = HTTPCookie("x", max_age=100, options=self.options)
Expand Down
17 changes: 12 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,29 @@ deps =
commands =
autoflake --in-place --remove-unused-variables --remove-all-unused-imports \
--recursive src/ demos/ setup.py
isort --profile black --combine-as --case-sensitive demos/ src/ setup.py
isort demos/ src/ setup.py
black -ql79 src/ demos/ setup.py
flake8 demos doc src setup.py

[testenv:docs]
deps = -r requirements/docs.txt
commands = sphinx-build -a -b html doc/ doc/_build/

[isort]
case_sensitive = true
known_local_folder = test_helloworld
known_third_party = wheezy.core
line_length = 79
profile = black

[flake8]
show-source = True
max-complexity = 13
# Codes: https://www.flake8rules.com/
ignore =
# Imported names are in the wrong order.
I101
# Import statements are in the wrong order.
I100
# Additional newline in a group of imports.
I202
# line break before binary operator
W503
# line break after binary operator
W504

0 comments on commit 07f063d

Please sign in to comment.