-
-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that socket exists on shutdown (#566)
* check that socket exists on shutdown * rm unused import * remove nil check for socket
- Loading branch information
Showing
3 changed files
with
74 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,25 +13,27 @@ def get_version(package): | |
""" | ||
Return package version as listed in `__version__` in `init.py`. | ||
""" | ||
path = os.path.join(package, '__init__.py') | ||
init_py = open(path, 'r', encoding='utf8').read() | ||
path = os.path.join(package, "__init__.py") | ||
init_py = open(path, "r", encoding="utf8").read() | ||
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) | ||
|
||
|
||
def get_long_description(): | ||
""" | ||
Return the README. | ||
""" | ||
return open('README.md', 'r', encoding='utf8').read() | ||
return open("README.md", "r", encoding="utf8").read() | ||
|
||
|
||
def get_packages(package): | ||
""" | ||
Return root package and all sub-packages. | ||
""" | ||
return [dirpath | ||
for dirpath, dirnames, filenames in os.walk(package) | ||
if os.path.exists(os.path.join(dirpath, '__init__.py'))] | ||
return [ | ||
dirpath | ||
for dirpath, dirnames, filenames in os.walk(package) | ||
if os.path.exists(os.path.join(dirpath, "__init__.py")) | ||
] | ||
|
||
|
||
env_marker = ( | ||
|
@@ -50,34 +52,34 @@ def get_packages(package): | |
|
||
|
||
setup( | ||
name='uvicorn', | ||
version=get_version('uvicorn'), | ||
url='https://github.com/encode/uvicorn', | ||
license='BSD', | ||
description='The lightning-fast ASGI server.', | ||
name="uvicorn", | ||
version=get_version("uvicorn"), | ||
url="https://github.com/encode/uvicorn", | ||
license="BSD", | ||
description="The lightning-fast ASGI server.", | ||
long_description=get_long_description(), | ||
long_description_content_type='text/markdown', | ||
author='Tom Christie', | ||
author_email='[email protected]', | ||
packages=get_packages('uvicorn'), | ||
long_description_content_type="text/markdown", | ||
author="Tom Christie", | ||
author_email="[email protected]", | ||
packages=get_packages("uvicorn"), | ||
install_requires=requirements, | ||
data_files = [("", ["LICENSE.md"])], | ||
data_files=[("", ["LICENSE.md"])], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Web Environment', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Topic :: Internet :: WWW/HTTP', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: Implementation :: PyPy', | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Web Environment", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
], | ||
entry_points=""" | ||
[console_scripts] | ||
uvicorn=uvicorn.main:main | ||
""" | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters