Skip to content

Commit 37139c9

Browse files
committed
Make pandoc optional
1 parent 92af8e1 commit 37139c9

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

setup.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33

44
from setuptools import setup, find_packages
5-
from pypandoc import convert
5+
import os
66

77
NAME = "deepaffects"
8-
VERSION = "1.1.1"
8+
VERSION = "1.1.2"
99
# To install the library, run the following
1010
#
1111
# python setup.py install
@@ -16,7 +16,17 @@
1616
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil", "pymediainfo >= 2.1.9"]
1717

1818
def readme():
19-
return convert('README.md', 'rst')
19+
try:
20+
from pypandoc import convert
21+
return convert('README.md', 'rst')
22+
23+
except ImportError:
24+
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
25+
return readme.read()
26+
27+
except OSError:
28+
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
29+
return readme.read()
2030

2131
setup(
2232
name=NAME,

0 commit comments

Comments
 (0)