-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdistutils_setup.py
78 lines (67 loc) · 2.42 KB
/
distutils_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
import re
import os
import sys
vi = sys.version_info
(major, minor) = (vi[0], vi[1])
if major != 2 or minor not in (6, 7):
raise Exception("Enversion requires either Python 2.6 or 2.7.")
try:
from svn import core, fs, ra
except ImportError:
msg = "Enversion requires Subversion's Python bindings to be installed."
raise Exception(msg)
from distutils.core import setup
basedir = os.path.abspath(os.path.dirname(__file__))
def join_path(*args):
return os.path.abspath(os.path.normpath(os.path.join(*args)))
def read(*parts):
with open(join_path(basedir, *parts), 'r') as f:
return f.read()
def find_packages(base):
packages = []
for pkg in ['evn']:
path = os.path.join(base, pkg)
for (dirname, subdirs, files) in os.walk(path):
if '__init__.py' in files:
(lib, fragment) = dirname.split(os.sep, 1)
packages.append(fragment.replace(os.sep, '.'))
return packages
def version():
return (
re.compile(r"^__version__ = '(.*?)'$", re.S)
.match(read('lib', 'evn', '__init__.py'))
.group(1)
)
def run_setup():
setup(
name='enversion',
version='0.2.5',
license='Apache',
description='Enterprise Subversion Framework',
author='Trent Nelson',
author_email='[email protected]',
url='http://github.com/tpn/enversion/',
keywords='subversion,svn,scm,pysvn',
packages=find_packages('lib'),
package_dir={'': 'lib'},
classifiers=[
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Development Status :: 3 - Alpha',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Configuration Managers',
'Intended Audience :: Information Technology',
'Programming Language :: Python',
'Programming Language :: Unix Shell',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Version Control',
'Topic :: Software Development :: Version Control :: Subversion',
],
)
if __name__ == '__main__':
run_setup()
# vim:set ts=8 sw=4 sts=4 tw=78 et: