From 4d0303cc75bdc860191d9736390f1fab8fce6be9 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 26 Nov 2012 14:27:02 -0500 Subject: [PATCH] Converts README.md file to ReST for setup's long_description. So that we can have one README.md in source control, but have a README that is compatible with PyPI. Adds pyandoc on which the doc conversion depends. --- etc/requirements_dev.txt | 4 ++++ setup.py | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/etc/requirements_dev.txt b/etc/requirements_dev.txt index f82f8df5..aacc8b94 100644 --- a/etc/requirements_dev.txt +++ b/etc/requirements_dev.txt @@ -9,3 +9,7 @@ requests==0.14.2 # Linting flake8==1.6.2 + +# Documentation Conversion + +pyandoc==0.0.1 diff --git a/setup.py b/setup.py index ed61ecd2..4e8d7474 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pandoc +pandoc.core.PANDOC_PATH = 'pandoc' + from setuptools import setup, find_packages + +def readme_as_rest(): + """ + Converts the README.md file to ReST, since PyPI uses ReST for formatting, + This allows to have one canonical README file, being the README.md + """ + doc = pandoc.Document() + with open('README.md').read() as markdown_source: + doc.markdown = markdown_source + return doc.rst + setup( name='zipline', version='0.5.3', @@ -23,7 +37,7 @@ setup( author='Quantopian Inc.', author_email='opensource@quantopian.com', packages=find_packages(), - long_description=open('README.md').read(), + long_description=readme_as_rest(), license='Apache 2.0', classifiers=[ 'Development Status :: 4 - Beta',