add readme to package directly

This commit is contained in:
Thomas Grainger 2017-05-02 10:04:58 +01:00
parent c6a7e44ae7
commit 9e502099e0
No known key found for this signature in database
GPG Key ID: 995EA0A029283160
2 changed files with 20 additions and 2 deletions

4
MANIFEST.in Normal file
View File

@ -0,0 +1,4 @@
include README.rst
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

View File

@ -9,14 +9,27 @@ from distutils.util import strtobool
from setuptools import setup 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: try:
version = re.findall(r"^__version__ = '([^']+)'\r?$", version = re.findall(r"^__version__ = '([^']+)'\r?$",
fp.read(), re.M)[0] fp.read(), re.M)[0]
except IndexError: except IndexError:
raise RuntimeError('Unable to determine version.') raise RuntimeError('Unable to determine version.')
with open_local(['README.rst']) as rm:
long_description = rm.read()
setup_kwargs = { setup_kwargs = {
'name': 'sanic', 'name': 'sanic',
'version': version, 'version': version,
@ -26,6 +39,7 @@ setup_kwargs = {
'author_email': 'channelcat@gmail.com', 'author_email': 'channelcat@gmail.com',
'description': ( 'description': (
'A microframework based on uvloop, httptools, and learnings of flask'), 'A microframework based on uvloop, httptools, and learnings of flask'),
'long_description': long_description,
'packages': ['sanic'], 'packages': ['sanic'],
'platforms': 'any', 'platforms': 'any',
'classifiers': [ 'classifiers': [