-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
executable file
·54 lines (49 loc) · 1.89 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
#!/usr/bin/env python
from datetime import datetime
import os
from setuptools import setup
import subprocess
def version():
from_file, from_git = None, None
receipt = 'ahab/version/VERSION'
default = datetime.utcnow().strftime('%Y%m%d') + '+unversioned'
if os.path.exists('.git'):
try:
txt = subprocess.check_output(['git', 'describe', '--tags'])
from_git = txt.strip().replace('-', '.', 1).replace('-g', '+', 1)
except subprocess.CalledProcessError:
pass
if os.path.exists(receipt):
with open(receipt) as h:
txt = h.read().strip()
if txt != '':
from_file = txt
version = from_git or from_file or default
with open(receipt, 'w+') as h:
h.write(version + '\n')
return version
setup(name='ahab',
maintainer='Instacart',
maintainer_email='open-source@instacart.com',
url='https://github.com/instacart/ahab',
version=version(),
install_requires=['argh',
'docker>=2.3.0',
'magiclog'],
setup_requires=['setuptools'],
tests_require=['flake8'],
description='Ahab: on which to hang your Docker hooks',
packages=['ahab',
'ahab.version'],
package_data={'ahab.version': ['VERSION']},
entry_points={'console_scripts': ['ahab = ahab.__main__:main']},
classifiers=['Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Operating System :: Unix',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: System',
'Topic :: System :: Systems Administration',
'Topic :: Software Development',
'Development Status :: 4 - Beta'])