From 1e4ad1da5935a5c482a7b49563e5544c51e10580 Mon Sep 17 00:00:00 2001 From: Taras Lehinevych Date: Fri, 13 Jul 2018 13:16:30 +0300 Subject: [PATCH] fix doc rendering for pypi --- README.md | 2 +- setup.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b27b1f..0ef52f6 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ MediaWikiAPI [![PyPI version](https://img.shields.io/pypi/v/mediawikiapi.svg)](https://pypi.python.org/pypi/mediawikiapi) [![Version](https://img.shields.io/pypi/pyversions/mediawikiapi.svg)](https://pypi.python.org/pypi/mediawikiapi) -[![Build Status](https://travis-ci.org/lehinevych/MediaWikiAPI.svg?branch=master)](https://travis-ci.org/leginevych/MediaWikiAPI) +[![Build Status](https://travis-ci.org/lehinevych/MediaWikiAPI.svg?branch=master)](https://travis-ci.org/lehinevych/MediaWikiAPI) [![GitHub Issues](https://img.shields.io/github/issues/lehinevych/MediaWikiAPI.svg)](https://github.com/lehinevych/MediaWikiAPI/issues) [![License](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)](https://opensource.org/licenses/MIT) [![Docs](https://readthedocs.org/projects/mediawikiapi/badge/?version=latest) diff --git a/setup.py b/setup.py index b5732c5..3113d1a 100755 --- a/setup.py +++ b/setup.py @@ -24,9 +24,12 @@ def local_file(file): if line.strip() != '' ] - -with open("README.md", "r") as fh: - long_description = fh.read() +try: + import pypandoc + long_description = pypandoc.convert_file('README.md', 'rst') +except(IOError, ImportError, OSError): + with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')) as f: + long_description = f.read() setuptools.setup( @@ -41,6 +44,7 @@ def local_file(file): install_requires = install_reqs, packages = ['mediawikiapi'], long_description = long_description, + long_description_content_type='text/markdown', classifiers = [ 'Development Status :: 4 - Beta', 'Topic :: Software Development :: Libraries',