Merge pull request #1117 from abuckenheimer/env_dependent_ujson_uvloop
only install ujson and uvloop with cpython on non windows machines
This commit is contained in:
commit
0b38dea613
|
@ -7,6 +7,6 @@ httptools
|
||||||
flake8
|
flake8
|
||||||
pytest==3.3.2
|
pytest==3.3.2
|
||||||
tox
|
tox
|
||||||
ujson
|
ujson; sys_platform != "win32" and implementation_name == "cpython"
|
||||||
uvloop
|
uvloop; sys_platform != "win32" and implementation_name == "cpython"
|
||||||
gunicorn
|
gunicorn
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
aiofiles
|
aiofiles
|
||||||
httptools
|
httptools
|
||||||
ujson
|
ujson; sys_platform != "win32" and implementation_name == "cpython"
|
||||||
uvloop
|
uvloop; sys_platform != "win32" and implementation_name == "cpython"
|
||||||
websockets
|
websockets
|
||||||
|
|
14
setup.py
14
setup.py
|
@ -51,8 +51,9 @@ setup_kwargs = {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
ujson = 'ujson>=1.35'
|
env_dependency = '; sys_platform != "win32" and implementation_name == "cpython"'
|
||||||
uvloop = 'uvloop>=0.5.3'
|
ujson = 'ujson>=1.35' + env_dependency
|
||||||
|
uvloop = 'uvloop>=0.5.3' + env_dependency
|
||||||
|
|
||||||
requirements = [
|
requirements = [
|
||||||
'httptools>=0.0.9',
|
'httptools>=0.0.9',
|
||||||
|
@ -66,16 +67,9 @@ if strtobool(os.environ.get("SANIC_NO_UJSON", "no")):
|
||||||
requirements.remove(ujson)
|
requirements.remove(ujson)
|
||||||
|
|
||||||
# 'nt' means windows OS
|
# 'nt' means windows OS
|
||||||
if strtobool(os.environ.get("SANIC_NO_UVLOOP", "no")) or os.name == 'nt':
|
if strtobool(os.environ.get("SANIC_NO_UVLOOP", "no")):
|
||||||
print("Installing without uvLoop")
|
print("Installing without uvLoop")
|
||||||
requirements.remove(uvloop)
|
requirements.remove(uvloop)
|
||||||
|
|
||||||
try:
|
|
||||||
setup_kwargs['install_requires'] = requirements
|
|
||||||
setup(**setup_kwargs)
|
|
||||||
except DistutilsPlatformError as exception:
|
|
||||||
requirements.remove(ujson)
|
|
||||||
requirements.remove(uvloop)
|
|
||||||
print("Installing without uJSON or uvLoop")
|
|
||||||
setup_kwargs['install_requires'] = requirements
|
setup_kwargs['install_requires'] = requirements
|
||||||
setup(**setup_kwargs)
|
setup(**setup_kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user