Skip to content

Commit

Permalink
Merge f747341 into 45ccb9a
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-tyler committed May 22, 2019
2 parents 45ccb9a + f747341 commit 02d68e2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=100
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ matrix:
sudo: required
python: 3.7
env: TOXENV=py37-vulture
- os: linux
sudo: required
python: 3.7
env: TOXENV=py37-isort
- os: linux
sudo: required
python: pypy3.5-6.0
Expand Down
5 changes: 2 additions & 3 deletions hug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from falcon import *

from hug import (
authentication,
directives,
exceptions,
format,
Expand Down Expand Up @@ -89,11 +88,11 @@
)
from hug.types import create as type

# The following imports must be imported last for defaults to have access to all modules
# The following imports must be imported last; in particular, defaults to have access to all modules
from hug import authentication # isort:skip
from hug import development_runner # isort:skip
from hug import defaults # isort:skip


try: # pragma: no cover - defaulting to uvloop if it is installed
import uvloop
import asyncio
Expand Down
1 change: 0 additions & 1 deletion requirements/build_common.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r common.txt
flake8==3.3.0
isort==4.2.5
pytest-cov==2.4.0
pytest==4.3.1
python-coveralls==2.9.0
Expand Down
3 changes: 2 additions & 1 deletion requirements/build_style_tools.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r build_common.txt
black==19.3b0
isort==4.3.20
pep8-naming==0.8.2
flake8-bugbear==19.3.0
vulture==1.0
bandit==1.6.0
bandit==1.6.0
10 changes: 6 additions & 4 deletions tests/test_full_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def post(body, response):
"""


@pytest.mark.skipif(platform.python_implementation() == "PyPy", reason="Can't run hug CLI from travis PyPy")
@pytest.mark.skipif(
platform.python_implementation() == "PyPy", reason="Can't run hug CLI from travis PyPy"
)
def test_hug_post(tmp_path):
hug_test_file = (tmp_path / "hug_postable.py")
hug_test_file = tmp_path / "hug_postable.py"
hug_test_file.write_text(TEST_HUG_API)
hug_server = Popen(['hug', '-f', str(hug_test_file), '-p', '3000'])
hug_server = Popen(["hug", "-f", str(hug_test_file), "-p", "3000"])
time.sleep(5)
requests.post('http://127.0.0.1:3000/test', {'data': 'here'})
requests.post("http://127.0.0.1:3000/test", {"data": "here"})
hug_server.kill()
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ deps=
whitelist_externals=flake8
commands=bandit -r hug/ -ll

[testenv:py37-isort]
deps=
-rrequirements/build_style_tools.txt
marshmallow >=3.0.0rc5

whitelist_externals=flake8
commands=isort -c --diff --recursive hug

[testenv:pywin]
deps =-rrequirements/build_windows.txt
basepython = {env:PYTHON:}\python.exe
Expand Down

0 comments on commit 02d68e2

Please sign in to comment.