Skip to content

Commit

Permalink
Adds the ability to convert README file for Pypi
Browse files Browse the repository at this point in the history
We can potentially use pypandoc to conditionally try to convert the current reaadme markdown into restructured text. If not will simply send over the markdown as is to Pypi.
  • Loading branch information
avelis authored Jul 12, 2016
1 parent 0342797 commit e4629ba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import os
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme_file:
README = readme_file.read()
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()

README = read_md('README.md')

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
Expand Down

0 comments on commit e4629ba

Please sign in to comment.