Update reqs to get tox running

This commit is contained in:
Adam Hopkins 2020-12-24 21:56:35 +02:00
parent 6515dde64b
commit b9b3b4051a
2 changed files with 15 additions and 9 deletions

View File

@ -5,6 +5,7 @@ import codecs
import os import os
import re import re
import sys import sys
from distutils.util import strtobool from distutils.util import strtobool
from setuptools import setup from setuptools import setup
@ -24,6 +25,7 @@ class PyTest(TestCommand):
def run_tests(self): def run_tests(self):
import shlex import shlex
import pytest import pytest
errno = pytest.main(shlex.split(self.pytest_args)) errno = pytest.main(shlex.split(self.pytest_args))
@ -38,7 +40,9 @@ def open_local(paths, mode="r", encoding="utf8"):
with open_local(["sanic", "__version__.py"], encoding="latin1") as fp: with open_local(["sanic", "__version__.py"], encoding="latin1") as fp:
try: try:
version = re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M)[0] version = re.findall(
r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M
)[0]
except IndexError: except IndexError:
raise RuntimeError("Unable to determine version.") raise RuntimeError("Unable to determine version.")
@ -72,7 +76,9 @@ setup_kwargs = {
"entry_points": {"console_scripts": ["sanic = sanic.__main__:main"]}, "entry_points": {"console_scripts": ["sanic = sanic.__main__:main"]},
} }
env_dependency = '; sys_platform != "win32" ' 'and implementation_name == "cpython"' env_dependency = (
'; sys_platform != "win32" ' 'and implementation_name == "cpython"'
)
ujson = "ujson>=1.35" + env_dependency ujson = "ujson>=1.35" + env_dependency
uvloop = "uvloop>=0.5.3" + env_dependency uvloop = "uvloop>=0.5.3" + env_dependency
@ -89,9 +95,9 @@ requirements = [
tests_require = [ tests_require = [
"pytest==5.2.1", "pytest==5.2.1",
"multidict>=5.0,<6.0", "multidict>=5.0,<6.0",
"gunicorn", "gunicorn==20.0.4",
"pytest-cov", "pytest-cov",
"httpcore==0.3.0", "httpcore==0.11.*",
"beautifulsoup4", "beautifulsoup4",
uvloop, uvloop,
ujson, ujson,

10
tox.ini
View File

@ -7,18 +7,18 @@ setenv =
{py36,py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UJSON=1 {py36,py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UJSON=1
{py36,py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UVLOOP=1 {py36,py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UVLOOP=1
deps = deps =
coverage coverage==5.3
pytest==5.2.1 pytest==5.2.1
pytest-cov pytest-cov
pytest-sanic pytest-sanic
pytest-sugar pytest-sugar
pytest-benchmark pytest-benchmark
pytest-dependency pytest-dependency
httpcore==0.3.0 httpcore==0.11.*
httpx==0.15.4 httpx==0.15.4
chardet<=2.3.0 chardet==3.*
beautifulsoup4 beautifulsoup4
gunicorn gunicorn==20.0.4
uvicorn uvicorn
websockets>=8.1,<9.0 websockets>=8.1,<9.0
commands = commands =
@ -76,7 +76,7 @@ deps =
recommonmark>=0.5.0 recommonmark>=0.5.0
docutils docutils
pygments pygments
gunicorn gunicorn==20.0.4
commands = commands =
make docs-test make docs-test