-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·93 lines (76 loc) · 2.53 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
from codecs import open
import os
from setuptools import setup
from subprocess import check_output
gitVersion = ''
gitPath = ''
# get git describe if in git repository
print('Fetching most recent git tags')
if os.path.exists('./.git'):
try:
# if we are in a git repo, fetch most recent tags
check_output(["git fetch --tags"], shell=True)
except Exception as e:
print(e)
print('Unable to fetch most recent tags')
try:
ls_proc = check_output(["git describe --tags"], shell=True, universal_newlines=True)
gitVersion = ls_proc
print('Checking most recent version')
except Exception as e:
print('Unable to get git tag and hash')
# if not in git repo
else:
print('Not in git repository')
gitVersion = ''
# get current working directory to define git path
gitPath = os.getcwd()
# git untracked file to store version and path
fname = os.path.abspath(os.path.expanduser('./snowav/utils/gitinfo.py'))
with open(fname, 'w') as f:
nchars = len(gitVersion) - 1
f.write("__gitPath__='{0}'\n".format(gitPath))
f.write("__gitVersion__='{0}'\n".format(gitVersion[:nchars]))
f.close()
with open('README.md') as readme_file:
readme = readme_file.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup_requirements = []
test_requirements = []
setup(
name='snowav',
version='0.11.16',
description="Snow and Water Model Analysis and Visualization ",
author="USDA ARS NWRC",
author_email='[email protected]',
url='https://github.com/USDA-ARS-NWRC/snowav',
packages=['snowav',
'snowav.config',
'snowav.framework',
'snowav.database',
'snowav.plotting',
'snowav.inflow',
'snowav.report',
'snowav.utils'
],
include_package_data=True,
package_data={'snowav': ['./config/CoreConfig.ini', './config/recipes.ini']},
scripts=['./snowav/cli.py'],
install_requires=required,
license="CC0 1.0",
zip_safe=False,
keywords='snowav',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
setup_requires=setup_requirements,
entry_points={'console_scripts': ['snowav = cli:run']},
test_suite='tests'
)