fix: linting errors

This commit is contained in:
Stephen Sadowski 2022-02-01 14:33:34 -06:00
parent 6e40292974
commit aef131af90
2 changed files with 4 additions and 7 deletions

View File

@ -18,7 +18,7 @@ def strtobool(query: str) -> bool:
elif query.lower() in ["n", "no", "f", "false", "off", "0"]: elif query.lower() in ["n", "no", "f", "false", "off", "0"]:
return False return False
else: else:
raise ValueError(f'String value {query} cannot be converted to bool') raise ValueError(f"String value {query} cannot be converted to bool")
def try_use_uvloop() -> None: def try_use_uvloop() -> None:

View File

@ -11,6 +11,7 @@ from setuptools.command.test import test as TestCommand
from sanic.utils import str_to_bool as strtobool from sanic.utils import str_to_bool as strtobool
class PyTest(TestCommand): class PyTest(TestCommand):
""" """
Provide a Test runner to be used from setup.py to run unit tests Provide a Test runner to be used from setup.py to run unit tests
@ -39,9 +40,7 @@ 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( version = re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M)[0]
r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M
)[0]
except IndexError: except IndexError:
raise RuntimeError("Unable to determine version.") raise RuntimeError("Unable to determine version.")
@ -76,9 +75,7 @@ setup_kwargs = {
"entry_points": {"console_scripts": ["sanic = sanic.__main__:main"]}, "entry_points": {"console_scripts": ["sanic = sanic.__main__:main"]},
} }
env_dependency = ( env_dependency = '; sys_platform != "win32" ' 'and implementation_name == "cpython"'
'; 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
types_ujson = "types-ujson" + env_dependency types_ujson = "types-ujson" + env_dependency