From 72ecd32c6b891395d0df98517195e01e1239234e Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Fri, 12 Feb 2016 13:15:20 +0100 Subject: [PATCH] Use pandoc to generate a nice PyPI information page. --- requirements/requirements-packaging.txt | 3 +++ setup.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/requirements/requirements-packaging.txt b/requirements/requirements-packaging.txt index 8f62ee365..89819da20 100644 --- a/requirements/requirements-packaging.txt +++ b/requirements/requirements-packaging.txt @@ -6,3 +6,6 @@ twine==1.4.0 # Transifex client for managing translation resources. transifex-client==0.11 + +# Pandoc to have a nice pypi page +pypandoc diff --git a/setup.py b/setup.py index 8e9d0a9ab..364863137 100755 --- a/setup.py +++ b/setup.py @@ -7,6 +7,17 @@ import sys from setuptools import setup +try: + from pypandoc import convert + + def read_md(f): + return convert(f, 'rst') +except ImportError: + print("warning: pypandoc module not found, could not convert Markdown to RST") + + def read_md(f): + return open(f, 'r').read() + def get_version(package): """ @@ -68,6 +79,7 @@ setup( url='http://www.django-rest-framework.org', license='BSD', description='Web APIs for Django, made easy.', + long_description=read_md('README.md'), author='Tom Christie', author_email='tom@tomchristie.com', # SEE NOTE BELOW (*) packages=get_packages('rest_framework'),