Skip to content

Commit

Permalink
Cleanup 'setup.py'
Browse files Browse the repository at this point in the history
- Remove unnecessary imports
- Stop checking for the presence of 'json' - it's been in stdlib since
  2.6 [1]
- Fix some formatting
- Remove invalid 'test_suite' configuration

[1] https://docs.python.org/2/library/json.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Mar 26, 2020
1 parent 6bceb40 commit 2806cef
Showing 1 changed file with 35 additions and 38 deletions.
73 changes: 35 additions & 38 deletions setup.py
@@ -1,33 +1,29 @@
# -*- coding: utf-8 -*-

import os
import sys

from setuptools import find_packages, setup

version = '0.96'

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
with open(os.path.join(os.path.dirname(__file__), *rnames)) as fh:
return fh.read()

long_description = read('README.rst')

install_requires = [
'docutils',
'jinja2',
'pdfrw',
'pygments',
'reportlab',
'setuptools',
'six',
'smartypants',
]
version = '0.96'

try:
import json
except ImportError:
install_requires.append('simplejson')
long_description = read('README.rst')

install_requires = [
'docutils',
'jinja2',
'pdfrw',
'pygments',
'reportlab',
'setuptools',
'six',
'smartypants',
]
tests_require = ['pyPdf2']
sphinx_require = ['sphinx']
hyphenation_require = ['wordaxe>=1.0']
Expand All @@ -41,26 +37,28 @@ def read(*rnames):
version=version,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
package_data=dict(rst2pdf=['styles/*.json',
'styles/*.style',
'images/*png',
'images/*jpg',
'templates/*tmpl'
]),
package_data={
"rst2pdf": [
"styles/*.json",
"styles/*.style",
"images/*png",
"images/*jpg",
"templates/*tmpl",
],
},
include_package_data=True,
dependency_links=[
],
dependency_links=[],
install_requires=install_requires,
tests_require=tests_require,
extras_require=dict(
tests=tests_require,
sphinx=sphinx_require,
hyphenation=hyphenation_require,
svgsupport=svgsupport_require,
aafiguresupport=aafiguresupport_require,
mathsupport=mathsupport_require,
rawhtmlsupport=rawhtmlsupport_require,
),
extras_require={
'tests': tests_require,
'sphinx': sphinx_require,
'hyphenation': hyphenation_require,
'svgsupport': svgsupport_require,
'aafiguresupport': aafiguresupport_require,
'mathsupport': mathsupport_require,
'rawhtmlsupport': rawhtmlsupport_require,
},
# metadata for upload to PyPI
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
Expand All @@ -70,9 +68,9 @@ def read(*rnames):
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Documentation',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand All @@ -93,5 +91,4 @@ def read(*rnames):
},
download_url="https://github.com/rst2pdf/rst2pdf/releases",
entry_points={'console_scripts': ['rst2pdf = rst2pdf.createpdf:main']},
test_suite='rst2pdf.tests.test_rst2pdf.test_suite', # TODO: this needs to be updated
)

0 comments on commit 2806cef

Please sign in to comment.