-
Notifications
You must be signed in to change notification settings - Fork 330
/
setup.py
53 lines (50 loc) · 1.69 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from distutils.core import setup
from setuptools.command.test import test as TestCommand
import re
import os
import sys
import pdfkit
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['pdfkit-tests.py']
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
os.chdir('tests/')
errno = pytest.main(self.test_args)
sys.exit(errno)
def long_description():
"""Pre-process the README so that PyPi can render it properly."""
with open('README.rst') as f:
rst = f.read()
code_block = '(:\n\n)?\.\. code-block::.*'
rst = re.sub(code_block, '::', rst)
return rst + '\n\n' + open('HISTORY.rst').read()
setup(
name='pdfkit',
version=pdfkit.__version__,
description=pdfkit.__doc__.strip(),
long_description=long_description(),
download_url='https://github.com/JazzCore/python-pdfkit',
license=pdfkit.__license__,
tests_require=['pytest'],
cmdclass = {'test': PyTest},
packages=['pdfkit'],
author=pdfkit.__author__,
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Text Processing',
'Topic :: Text Processing :: General',
'Topic :: Text Processing :: Markup',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Text Processing :: Markup :: XML',
'Topic :: Utilities'
]
)