Skip to content

Commit

Permalink
Fix setup to only convert readme for pypi (not at installation)
Browse files Browse the repository at this point in the history
  • Loading branch information
reingart committed Jan 21, 2015
1 parent 2dfdfa7 commit cfe3d03
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

from distutils.core import setup

import os
import sys
import warnings
import subprocess

import fpdf
package_dir = 'fpdf'

# convert the and format in restructured text
try:
long_desc = subprocess.check_output(['pandoc', '--from=markdown', '--to=rst',
'README.md']).decode("utf8")
except OSError as e:
warnings.warn("pandoc not available to convert the README format!: %s" % e)
long_desc = ""
# convert the README and format in restructured text (only when registering)
long_desc = ""
if os.path.exists("README.md"):
try:
cmd = ['pandoc', '--from=markdown', '--to=rst', 'README.md']
long_desc = subprocess.check_output(cmd).decode("utf8")
except Exception as e:
warnings.warn("Exception when converting the README format: %s" % e)

setup(name='fpdf',
version=fpdf.__version__,
Expand Down

0 comments on commit cfe3d03

Please sign in to comment.