-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·73 lines (57 loc) · 2.07 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
#!/usr/bin/env python3
import sys
from setuptools import setup
import subprocess
VERSION = '0.1.4'
class CommandError(Exception):
pass
def run(args):
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise CommandError('Error with the command %s.\n' % ' '.join(args))
return stdout.decode('ascii').strip()
def git_version():
return run(['git', 'rev-parse', 'HEAD'])
def git_tag():
return run(['git', 'describe', '--always', '--dirty'])
def write_version(filename, version_dict):
with open(filename, 'w') as f:
for version_name in version_dict:
f.write('%s = "%s"\n' % (version_name, version_dict[version_name]))
try:
with open('README.md') as f:
long_description = ''.join(f.readlines())
except (IOError, ImportError, RuntimeError):
print('Could not generate long description.')
long_description = ''
if __name__ == '__main__':
try:
write_version('pycewise/version.py', {
'__version__': VERSION,
'__git_version__': git_version(),
})
except CommandError as e:
if sys.argv[0] != '-c':
sys.exit(e)
setup(name='pycewise',
version=VERSION,
description='Piecewise linear regressions, based on model trees.',
long_description_content_type="text/markdown",
long_description=long_description,
author='Tom Cornebize',
author_email='[email protected]',
packages=['pycewise'],
url='https://github.com/Ezibenroc/pycewise',
install_requires=[],
license='MIT',
classifiers=[
'License :: OSI Approved :: MIT License',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)