forked from python/pyperformance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
115 lines (101 loc) · 3.18 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env python3
# FIXME:
#
# - REENABLE HG_STARTUP BENCHMARK.
# - REENABLE GENSHI BENCHMARK.
#
# Update dependencies:
#
# - python3 -m pip install --user --upgrade pip-tools
# - git clean -fdx # remove all untracked files!
# - (cd pyperformance; pip-compile --upgrade requirements.in)
#
# Prepare a release:
#
# - git pull --rebase
# - Remove untracked files/dirs: git clean -fdx
# - maybe update version in pyperformance/__init__.py and doc/conf.py
# - set release date in doc/changelog.rst
# - git commit -a -m "prepare release x.y"
# - run tests: tox --parallel auto
# - git push
# - check the CI status:
# https://github.com/python/pyperformance/actions
#
# Release a new version:
#
# - git tag VERSION
# - git push --tags
# - Remove untracked files/dirs: git clean -fdx
# - python3 setup.py sdist bdist_wheel
# - twine upload dist/*
#
# After the release:
#
# - set version to n+1: pyperformance/__init__.py and doc/conf.py
# - git commit -a -m "post-release"
# - git push
# Import just to get the version
import pyperformance
VERSION = pyperformance.__version__
DESCRIPTION = 'Python benchmark suite'
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python',
]
# put most of the code inside main() to be able to import setup.py in
# unit tests
def main():
import io
import os.path
from setuptools import setup
with io.open('README.rst', encoding="utf8") as fp:
long_description = fp.read().strip()
packages = [
'pyperformance',
'pyperformance.benchmarks',
'pyperformance.benchmarks.data',
'pyperformance.benchmarks.data.2to3',
'pyperformance.tests',
'pyperformance.tests.data',
]
data = {
'pyperformance': ['requirements.txt'],
'pyperformance.tests': ['data/*.json'],
}
# Search for all files in pyperformance/benchmarks/data/
data_dir = os.path.join('pyperformance', 'benchmarks', 'data')
benchmarks_data = []
for root, dirnames, filenames in os.walk(data_dir):
# Strip pyperformance/benchmarks/ prefix
root = os.path.normpath(root)
root = root.split(os.path.sep)
root = os.path.sep.join(root[2:])
for filename in filenames:
filename = os.path.join(root, filename)
benchmarks_data.append(filename)
data['pyperformance.benchmarks'] = benchmarks_data
options = {
'name': 'pyperformance',
'version': VERSION,
'author': 'Collin Winter and Jeffrey Yasskin',
'license': 'MIT license',
'description': DESCRIPTION,
'long_description': long_description,
'url': 'https://github.com/python/benchmarks',
'classifiers': CLASSIFIERS,
'packages': packages,
'package_data': data,
'entry_points': {
'console_scripts': ['pyperformance=pyperformance.cli:main']
},
'install_requires': ["pyperf"],
}
setup(**options)
if __name__ == '__main__':
main()