-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
92 lines (81 loc) · 2.55 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
import codecs
import re
from setuptools import setup, find_packages
RE_REQUIREMENT = re.compile(r'^\s*-r\s*(?P<filename>.*)$')
PYPI_RST_FILTERS = (
# Replace code-blocks
(r'\.\.\s? code-block::\s*(\w|\+)+', '::'),
# Remove all badges
(r'\.\. image:: .*', ''),
(r' :target: .*', ''),
(r' :alt: .*', ''),
)
def rst(filename):
'''
Load rst file and sanitize it for PyPI.
Remove unsupported github tags:
- code-block directive
- all badges
'''
content = codecs.open(filename, encoding='utf-8').read()
for regex, replacement in PYPI_RST_FILTERS:
content = re.sub(regex, replacement, content)
return content
long_description = '\n'.join((
rst('README.rst'),
rst('CHANGELOG.rst'),
''
))
# Import metadatas
exec(compile(open('minibench/__about__.py').read(),
'minibench/__about__.py', 'exec'))
tests_require = ['nose', 'rednose', 'markdown', 'docutils']
install_requires = ['click', 'six']
dev_requires = ['invoke', 'tox', 'flake8', 'sphinx', 'sphinx_rtd_theme', 'bumpr']
setup(
name='minibench',
version=__version__,
description=__description__,
long_description=long_description,
url=__url__,
author=__author__,
author_email=__email__,
packages=find_packages(),
include_package_data=True,
install_requires=install_requires,
tests_require=tests_require,
extras_require={
'test': tests_require,
'dev': dev_requires,
},
entry_points={
'console_scripts': [
'bench = minibench.cli:cli',
]
},
license='MIT',
zip_safe=False,
keywords='benchmark test development reporting performance',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Topic :: Software Development :: Testing',
'Topic :: System :: Benchmark',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: MIT License',
],
)