-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
58 lines (45 loc) · 1.48 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
#!/usr/bin/python3
"""Installation script for spowtd
"""
from distutils.core import setup
import glob
import os.path
import re
import subprocess
SCRIPTS = glob.glob('bin/*[!~]')
with open('README.txt') as readme_file:
LONG_DESCRIPTION = readme_file.read()
del readme_file
def build_docs():
"""Build docs for package
"""
subprocess.check_call(['scons', '-f', 'src/SConstruct'])
return ['doc/spowtd.1', 'doc/user_guide.pdf']
def get_version():
"""Get project version
"""
version_file_path = os.path.join(
os.path.dirname(__file__),
'spowtd',
'VERSION.txt')
with open(version_file_path) as version_file:
version_string = version_file.read().strip()
version_string_re = re.compile('[0-9.]+')
match = version_string_re.match(version_string)
if match is None:
raise ValueError(
'version string "{}" does not match regexp "{}"'
.format(version_string, version_string_re.pattern))
return match.group(0)
setup(name='spowtd',
version=get_version(),
description='Scalar parameterization of water table dynamics',
author='Alex Cobb',
author_email='[email protected]',
long_description=LONG_DESCRIPTION,
packages=['spowtd',
'spowtd/test'],
package_data={'spowtd': ['VERSION.txt', 'schema.sql'],
'spowtd.test': ['sample_data/*.txt']},
data_files=[('/usr/share/man/man1', build_docs())],
scripts=SCRIPTS)