From c3b8c7952c4ce52bb901703d8522d7d3947fa1d1 Mon Sep 17 00:00:00 2001
From: dave <dave@dtu.dk>
Date: Tue, 6 Dec 2016 15:31:43 +0100
Subject: [PATCH] setup.py: use rst formatted readme for PyPi

---
 setup.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index c2af0c0..db5e773 100644
--- a/setup.py
+++ b/setup.py
@@ -12,6 +12,13 @@ import os
 import sys
 from setuptools import setup
 
+try:
+    from pypandoc import convert_file
+    read_md = lambda f: convert_file(f, 'rst')
+except ImportError:
+    print("warning: pypandoc module not found, could not convert Markdown to RST")
+    read_md = lambda f: open(f, 'r').read()
+
 import numpy as np
 from distutils.extension import Extension
 from Cython.Distutils import build_ext
@@ -31,7 +38,8 @@ def setup_package():
     setup(setup_requires=['six', 'pyscaffold>=2.5a0,<2.6a0'] + sphinx,
           cmdclass = {'build_ext': build_ext},
           ext_modules = extlist,
-          use_pyscaffold=True)
+          use_pyscaffold=True,
+          long_description=read_md('README.md'))
 
 
 if __name__ == "__main__":
-- 
GitLab