|
6 | 6 | # arzaroth@arzaroth.com |
7 | 7 | # |
8 | 8 |
|
9 | | -import os |
10 | 9 | import io |
| 10 | +import os |
11 | 11 |
|
12 | | -from setuptools import setup, find_packages |
13 | | -from setuptools import Extension |
| 12 | +from setuptools import Extension, find_packages, setup |
14 | 13 |
|
15 | | -long_descr = 'Python bindings for RapidXml, a C++ XML parsing library' |
16 | | -try: |
17 | | - import pypandoc |
18 | | - long_descr = pypandoc.convert('README.md', 'rst') |
19 | | - long_descr = long_descr.replace("\r", "") |
20 | | -except (ImportError, OSError): |
21 | | - if os.path.exists('README.md'): |
22 | | - with io.open('README.md', encoding="utf-8") as f: |
23 | | - long_descr = f.read() |
| 14 | + |
| 15 | +def read_readme(): |
| 16 | + readme_path = 'README.md' |
| 17 | + if os.path.exists(readme_path): |
| 18 | + with io.open(readme_path, encoding="utf-8") as fh: |
| 19 | + return fh.read() |
| 20 | + return 'Python bindings for RapidXml, a C++ XML parsing library' |
24 | 21 |
|
25 | 22 | VERSION = ("2", "1", "2") |
26 | 23 |
|
| 24 | +long_descr = read_readme() |
| 25 | + |
27 | 26 | rapidxml = Extension("rapidxml.c_ext", |
28 | 27 | define_macros=[('MAJOR_VERSION', VERSION[0]), |
29 | 28 | ('MINOR_VERSION', VERSION[1])], |
|
57 | 56 |
|
58 | 57 | description='Python RapidXml Library', |
59 | 58 | long_description=long_descr, |
| 59 | + long_description_content_type='text/markdown', |
60 | 60 | keywords='rapidxml xml parsing', |
61 | 61 |
|
62 | 62 | packages=find_packages('.'), |
|
0 commit comments