diff --git a/hug/json_module.py b/hug/json_module.py index f881f7f8..c1176c6b 100644 --- a/hug/json_module.py +++ b/hug/json_module.py @@ -1,6 +1,6 @@ import os -HUG_USE_UJSON = bool(os.environ.get("HUG_USE_UJSON", 1)) +HUG_USE_UJSON = os.environ.get("HUG_USE_UJSON", "false").lower() == "true" try: # pragma: no cover if HUG_USE_UJSON: import ujson as json diff --git a/requirements/build_common.txt b/requirements/build_common.txt index a312c6de..42f25d29 100644 --- a/requirements/build_common.txt +++ b/requirements/build_common.txt @@ -1,9 +1,6 @@ -r common.txt +-r test.txt flake8==3.5.0 -pytest-cov==2.7.1 -pytest==4.6.3 -python-coveralls==2.9.2 wheel==0.33.4 PyJWT==1.7.1 -pytest-xdist==1.29.0 numpy<1.16 diff --git a/requirements/build_windows.txt b/requirements/build_windows.txt index a67127df..c936225c 100644 --- a/requirements/build_windows.txt +++ b/requirements/build_windows.txt @@ -1,8 +1,8 @@ -r common.txt flake8==3.7.7 isort==4.3.20 +wheel==0.33.4 +numpy==1.15.4 marshmallow==2.18.1 pytest==4.6.3 -wheel==0.33.4 pytest-xdist==1.29.0 -numpy==1.15.4 diff --git a/requirements/development.txt b/requirements/development.txt index 4142d01c..50e0e8c8 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,16 +1,12 @@ bumpversion==0.5.3 Cython==0.29.10 -r common.txt +-r test.txt +tox==3.12.1 flake8==3.7.7 -ipython==7.5.0 isort==4.3.20 -pytest-cov==2.7.1 -pytest==4.6.3 -python-coveralls==2.9.2 -tox==3.12.1 wheel -pytest-xdist==1.29.0 +numpy<1.16 marshmallow==2.18.1 +ipython==7.5.0 ujson==1.35 -numpy<1.16 - diff --git a/requirements/marshmallow2.txt b/requirements/marshmallow2.txt new file mode 100644 index 00000000..c343e156 --- /dev/null +++ b/requirements/marshmallow2.txt @@ -0,0 +1 @@ +marshmallow<3.0 diff --git a/requirements/marshmallow3.txt b/requirements/marshmallow3.txt new file mode 100644 index 00000000..341df9c3 --- /dev/null +++ b/requirements/marshmallow3.txt @@ -0,0 +1 @@ +marshmallow==3.0.0rc6 diff --git a/requirements/test.txt b/requirements/test.txt new file mode 100644 index 00000000..0f37bfa0 --- /dev/null +++ b/requirements/test.txt @@ -0,0 +1,4 @@ +pytest==4.6.3 +pytest-cov==2.7.1 +pytest-xdist==1.29.0 +python-coveralls==2.9.2 diff --git a/tox.ini b/tox.ini index 62d638e2..f82a9636 100644 --- a/tox.ini +++ b/tox.ini @@ -4,8 +4,17 @@ envlist=py{35,36,37,38,py3}-marshmallow{2,3}, cython-marshmallow{2,3} [testenv] deps= -rrequirements/build_common.txt - marshmallow2: marshmallow <3.0 - marshmallow3: marshmallow==3.0.0rc6 + marshmallow2: -rrequirements/marshmallow2.txt + marshmallow3: -rrequirements/marshmallow3.txt + +whitelist_externals=flake8 +commands=py.test --durations 3 --cov-report html --cov hug -n auto tests + +[testdevelopment] +deps= + -rrequirements/development.txt + marshmallow2: -rrequirements/marshmallow2.txt + marshmallow3: -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=py.test --durations 3 --cov-report html --cov hug -n auto tests @@ -13,7 +22,7 @@ commands=py.test --durations 3 --cov-report html --cov hug -n auto tests [testenv:py37-black] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=black --check --verbose -l 100 hug @@ -21,7 +30,7 @@ commands=black --check --verbose -l 100 hug [testenv:py37-vulture] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=vulture hug --min-confidence 100 --ignore-names req_succeeded @@ -30,7 +39,7 @@ commands=vulture hug --min-confidence 100 --ignore-names req_succeeded [testenv:py37-flake8] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=flake8 hug @@ -38,7 +47,7 @@ commands=flake8 hug [testenv:py37-bandit] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=bandit -r hug/ -ll @@ -46,7 +55,7 @@ commands=bandit -r hug/ -ll [testenv:py37-isort] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=isort -c --diff --recursive hug @@ -54,7 +63,7 @@ commands=isort -c --diff --recursive hug [testenv:py37-safety] deps= -rrequirements/build_style_tools.txt - marshmallow==3.0.0rc6 + -rrequirements/marshmallow3.txt whitelist_externals=flake8 commands=safety check -i 36810 @@ -65,5 +74,5 @@ basepython = {env:PYTHON:}\python.exe commands=py.test hug -n auto tests [testenv:cython] -deps=Cython - -rrequirements/build.txt +deps=-rrequirements/build.txt + Cython