From 9e502099e01bf50c7b760b8b3725220848d0db84 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 2 May 2017 10:04:58 +0100 Subject: [PATCH 1/3] add readme to package directly --- MANIFEST.in | 4 ++++ setup.py | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..7682c1b6 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include README.rst + +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/setup.py b/setup.py index aa5f2b08..5784283b 100644 --- a/setup.py +++ b/setup.py @@ -9,14 +9,27 @@ from distutils.util import strtobool from setuptools import setup -with codecs.open(os.path.join(os.path.abspath(os.path.dirname( - __file__)), 'sanic', '__init__.py'), 'r', 'latin1') as fp: + +def open_local(paths, mode='r', encoding='latin1'): + path = os.path.join( + os.path.abspath(os.path.dirname(__file__)), + *paths + ) + + return codecs.open(path, mode, encoding) + + +with open_local(['sanic', '__init__.py']) as fp: try: version = re.findall(r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0] except IndexError: raise RuntimeError('Unable to determine version.') + +with open_local(['README.rst']) as rm: + long_description = rm.read() + setup_kwargs = { 'name': 'sanic', 'version': version, @@ -26,6 +39,7 @@ setup_kwargs = { 'author_email': 'channelcat@gmail.com', 'description': ( 'A microframework based on uvloop, httptools, and learnings of flask'), + 'long_description': long_description, 'packages': ['sanic'], 'platforms': 'any', 'classifiers': [ From 77b6413526ae6e74601c7c4a9ed347f8ff058a69 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 2 May 2017 09:55:01 +0100 Subject: [PATCH 2/3] validate readme for PyPI --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 67970ae1..64015d2c 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ Sanic -================================= +===== |Join the chat at https://gitter.im/sanic-python/Lobby| |Build Status| |PyPI| |PyPI version| @@ -86,8 +86,9 @@ Documentation TODO ---- -* Streamed file processing -* http2 + * Streamed file processing + * http2 + Limitations ----------- * No wheels for uvloop and httptools on Windows :( From 9d2e32902d29f92fbee184fcdd221ac91d6a051a Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 2 May 2017 10:17:24 +0100 Subject: [PATCH 3/3] check readme in travis --- tox.ini | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 0e6dc7c6..dd940f13 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] -envlist = py35, py36, flake8 +envlist = py35, py36, flake8, check [travis] python = - 3.5: py35, flake8 - 3.6: py36, flake8 + 3.5: py35, flake8, check + 3.6: py36, flake8, check [testenv] @@ -24,3 +24,10 @@ deps = commands = flake8 sanic + +[testenv:check] +deps = + docutils + pygments +commands = + python setup.py check -r -s