Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74e5c1f

Browse files
committed
Patch up setup for (degraded) building without pandoc around
1 parent 9d62d06 commit 74e5c1f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import setuptools
2+
import sys
23
import os.path
34
import subprocess
45

5-
# Build README.txt from README.md if not present
6-
if not os.path.exists('README.txt'):
6+
7+
# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
8+
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
79
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md'])
810

11+
# But use the best README around
12+
readme = 'README.txt' if os.path.exists('README.txt') else 'README.md'
13+
914
setuptools.setup(
1015
name='jsonpath-rw',
1116
version='0.3',
@@ -14,7 +19,7 @@
1419
author_email='[email protected]',
1520
url='https://github.com/kennknowles/python-jsonpath-rw',
1621
license='Apache 2.0',
17-
long_description=open('README.txt').read(),
22+
long_description=open(readme).read(),
1823
packages = ['jsonpath_rw'],
1924
test_suite = 'tests',
2025
install_requires = [ 'ply', 'decorator', 'six' ],

0 commit comments

Comments
 (0)