-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.py
76 lines (63 loc) · 2.11 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
#!/usr/bin/env python
import os
import re
from setuptools import find_packages, setup
def text_of(relpath):
"""
Return string containing the contents of the file at *relpath* relative to
this file.
"""
thisdir = os.path.dirname(__file__)
file_path = os.path.join(thisdir, os.path.normpath(relpath))
with open(file_path) as f:
text = f.read()
return text
# Read the version from cxml.__version__ without importing the package
# (and thus attempting to import packages it depends on that may not be
# installed yet)
version = re.search(
"__version__ = '([^']+)'", text_of('cxml/__init__.py')
).group(1)
NAME = 'cxml'
VERSION = version
DESCRIPTION = 'Translate Compact XML (CXML) expression to XML'
KEYWORDS = 'xml testing'
AUTHOR = 'Steve Canny'
AUTHOR_EMAIL = '[email protected]'
URL = 'https://github.com/python-openxml/cxml'
LICENSE = text_of('LICENSE')
PACKAGES = find_packages(exclude=['tests', 'tests.*'])
TEST_SUITE = 'tests'
TESTS_REQUIRE = ['mock', 'pytest']
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries'
]
LONG_DESCRIPTION = text_of('README.rst') + '\n\n' + text_of('HISTORY.rst')
params = {
'name': NAME,
'version': VERSION,
'description': DESCRIPTION,
'keywords': KEYWORDS,
'long_description': LONG_DESCRIPTION,
'author': AUTHOR,
'author_email': AUTHOR_EMAIL,
'url': URL,
'license': LICENSE,
'packages': PACKAGES,
'tests_require': TESTS_REQUIRE,
'test_suite': TEST_SUITE,
'classifiers': CLASSIFIERS,
}
setup(**params)