-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
55 lines (46 loc) · 1.44 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
import os
import datetime
import time
from subprocess import check_output
from setuptools import setup, find_packages
CI_SERVER = os.environ.get('CI_SERVER') == 'yes'
def get_version():
major = datetime.date.today().strftime('%Y%m%d')
if CI_SERVER:
minor = os.environ['CI_BUILD_ID']
else:
minor = int(time.time())
return '{major}.{minor}'.format(**locals())
def get_description():
if CI_SERVER:
ref_name = os.environ['CI_BUILD_REF_NAME']
ref_sha1 = os.environ['CI_BUILD_REF']
else:
ref_name = check_output(['git', 'describe', '--all']).strip()
ref_sha1 = check_output(['git', 'rev-parse', ref_name]).strip()
return '%s (%s)' % (ref_name, ref_sha1)
def get_requirements():
with open('requirements/base.txt') as requirements:
return [line.split('#', 1)[0].strip() for line in requirements
if line and not line.startswith(('#', '--'))],
setup(
name='saturn',
version=get_version(),
author='Saturn Team',
author_email='[email protected]',
description='staturn framework',
long_description=get_description(),
license='Private',
include_package_data=True,
platforms=['GNU/Linux', 'Mac OS X'],
packages=find_packages(),
install_requires=get_requirements(),
entry_points={
'console_scripts': [
'saturnctl = saturn.app:main'
],
},
classifiers=[
'Private :: Do Not Upload',
]
)