From 9c1d80a56d4fed409994ef4bb557abfe11e7e2b1 Mon Sep 17 00:00:00 2001 From: Carl George Date: Mon, 15 Oct 2018 14:34:23 -0500 Subject: [PATCH 1/4] Make dependencies optional resolves #219 --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e91fd3679..a813c06f4 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ import os import re import sys -import platform from setuptools import setup @@ -60,8 +59,19 @@ def get_packages(package): author='Tom Christie', author_email='tom@tomchristie.com', packages=get_packages('uvicorn'), - install_requires=requirements, data_files = [("", ["LICENSE.md"])], + install_requires=[ + 'click' + 'h11', + 'wsproto' + ], + extras_require={ + 'full': [ + 'uvloop', + 'httptools', + 'websockets>=6.0' + ] + }, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', From 5c5b17cc19e0e271ee6585b2b5241f43f3488c0b Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Sun, 10 Feb 2019 18:08:02 +0100 Subject: [PATCH 2/4] Tweak install options and update installation instructions in readme --- README.md | 3 ++- requirements.txt | 2 ++ setup.py | 14 +++----------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0f76a9725..f02972fd7 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ Uvicorn currently supports HTTP/1.1 and WebSockets. Support for HTTP/2 is planne Install using `pip`: ```shell -$ pip install uvicorn +$ pip install uvicorn[pure] # Install pure Python deps (works anywhere) +$ pip install uvicorn[fast] # Install fast deps (not for e.g. Windows or Pypy) ``` Create an application, in `example.py`: diff --git a/requirements.txt b/requirements.txt index 0e0333e3e..1b5e213ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ click + +# Pure h11 # Optional diff --git a/setup.py b/setup.py index a813c06f4..716d979df 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ import os import re -import sys from setuptools import setup @@ -60,17 +59,10 @@ def get_packages(package): author_email='tom@tomchristie.com', packages=get_packages('uvicorn'), data_files = [("", ["LICENSE.md"])], - install_requires=[ - 'click' - 'h11', - 'wsproto' - ], + install_requires=['click'], extras_require={ - 'full': [ - 'uvloop', - 'httptools', - 'websockets>=6.0' - ] + 'pure': ['h11', 'wsproto==0.13.*'], + 'fast': ['uvloop', 'httptools', 'websockets>=6.0'], }, classifiers=[ 'Development Status :: 4 - Beta', From bd58915135cf79173af5334e7e5422f671a4b3ee Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Mon, 4 Nov 2019 10:43:33 +0100 Subject: [PATCH 3/4] update to latest conclusion --- README.md | 4 ++-- requirements.txt | 3 +-- setup.py | 12 ++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f02972fd7..e058a5a6f 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ Uvicorn currently supports HTTP/1.1 and WebSockets. Support for HTTP/2 is planne Install using `pip`: ```shell -$ pip install uvicorn[pure] # Install pure Python deps (works anywhere) -$ pip install uvicorn[fast] # Install fast deps (not for e.g. Windows or Pypy) +$ pip install uvicorn # Install with minimal (pure Python) deps +$ pip install uvicorn[default] # Install with fast deps (where possible) ``` Create an application, in `example.py`: diff --git a/requirements.txt b/requirements.txt index 1b5e213ee..2be375b82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ +# Minimal click - -# Pure h11 # Optional diff --git a/setup.py b/setup.py index 716d979df..58252478c 100755 --- a/setup.py +++ b/setup.py @@ -38,9 +38,12 @@ def get_packages(package): " and platform_python_implementation != 'pypy'" ) -requirements = [ +minimal_requirements = [ "click==7.*", "h11==0.8.*", +] + +extra_requirements = [ "websockets==8.*", "httptools==0.0.13 ;" + env_marker, "uvloop==0.14.0rc2 ;" + env_marker, @@ -59,11 +62,8 @@ def get_packages(package): author_email='tom@tomchristie.com', packages=get_packages('uvicorn'), data_files = [("", ["LICENSE.md"])], - install_requires=['click'], - extras_require={ - 'pure': ['h11', 'wsproto==0.13.*'], - 'fast': ['uvloop', 'httptools', 'websockets>=6.0'], - }, + install_requires=minimal_requirements, + extras_require={'default': extra_requirements}, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', From 6341b416fbf4bb00e4a3de0d4e548c58c669b200 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Mon, 4 Nov 2019 12:30:22 +0100 Subject: [PATCH 4/4] rename default -> standard --- README.md | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e058a5a6f..554d4a8b9 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Install using `pip`: ```shell $ pip install uvicorn # Install with minimal (pure Python) deps -$ pip install uvicorn[default] # Install with fast deps (where possible) +$ pip install uvicorn[standard] # Install with fast deps (where possible) ``` Create an application, in `example.py`: diff --git a/setup.py b/setup.py index 58252478c..8ebf9c7e2 100755 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ def get_packages(package): packages=get_packages('uvicorn'), data_files = [("", ["LICENSE.md"])], install_requires=minimal_requirements, - extras_require={'default': extra_requirements}, + extras_require={'standard': extra_requirements}, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment',