Add sanic as an entry point command (#1866)

* Add sanic as an entry point command

* Fix linting issue in imports

Co-authored-by: 7 <yunxu1992@gmail.com>
This commit is contained in:
Adam Hopkins
2020-06-05 17:14:18 +03:00
committed by GitHub
parent fa4f85eb32
commit 496e87e4ba
15 changed files with 66 additions and 47 deletions

View File

@@ -5,7 +5,6 @@ import codecs
import os
import re
import sys
from distutils.util import strtobool
from setuptools import setup
@@ -39,9 +38,7 @@ def open_local(paths, mode="r", encoding="utf8"):
with open_local(["sanic", "__version__.py"], encoding="latin1") as fp:
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:
raise RuntimeError("Unable to determine version.")
@@ -70,11 +67,10 @@ setup_kwargs = {
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
"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
uvloop = "uvloop>=0.5.3" + env_dependency