-
-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve PyPy and Windows support (#130)
* Improve PyPy and Windows support * Use platform-appropriate defaults in uvicorn.run * Explicit encoding when using 'open' in setup.py * Version 0.2.13 * Fix to setup.py
- Loading branch information
1 parent
dd5c2c3
commit c1f1d17
Showing
3 changed files
with
49 additions
and
15 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import os | ||
import re | ||
import sys | ||
import platform | ||
|
||
from setuptools import setup | ||
|
||
|
@@ -12,15 +13,16 @@ def get_version(package): | |
""" | ||
Return package version as listed in `__version__` in `init.py`. | ||
""" | ||
init_py = open(os.path.join(package, '__init__.py')).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').read() | ||
return open('README.md', 'r', encoding='utf8').read() | ||
|
||
|
||
def get_packages(package): | ||
|
@@ -32,6 +34,28 @@ def get_packages(package): | |
if os.path.exists(os.path.join(dirpath, '__init__.py'))] | ||
|
||
|
||
if platform.python_implementation() == 'PyPy': | ||
requirements = [ | ||
'click', | ||
'h11', | ||
'websockets>=6.0' | ||
] | ||
elif platform.system() == 'Windows' or platform.system().startswith('CYGWIN'): | ||
requirements = [ | ||
'click', | ||
'h11', | ||
'websockets>=6.0' | ||
] | ||
else: | ||
requirements = [ | ||
'click', | ||
'h11', | ||
'httptools', | ||
'uvloop', | ||
'websockets>=6.0' | ||
] | ||
|
||
|
||
setup( | ||
name='uvicorn', | ||
version=get_version('uvicorn'), | ||
|
@@ -43,13 +67,7 @@ def get_packages(package): | |
author='Tom Christie', | ||
author_email='[email protected]', | ||
packages=get_packages('uvicorn'), | ||
install_requires=[ | ||
'click', | ||
'h11', | ||
'httptools', | ||
'uvloop', | ||
'websockets>=6.0' | ||
], | ||
install_requires=requirements, | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Environment :: Web Environment', | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from uvicorn.main import main, run | ||
|
||
__version__ = "0.2.12" | ||
__version__ = "0.2.13" | ||
__all__ = ["main", "run"] |
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