This repository was archived by the owner on Mar 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (54 loc) · 1.56 KB
/
setup.py
File metadata and controls
58 lines (54 loc) · 1.56 KB
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
#
# to build the distrubution @ dist/ecs-*.*.*.tar.gz
#
# >git clone https://github.com/simonsdave/ecs.git
# >cd ecs
# >python setup.py sdist --formats=gztar
#
import re
from setuptools import setup
#
# this approach used below to determine ```version``` was inspired by
# https://github.com/kennethreitz/requests/blob/master/setup.py#L31
#
# why this complexity? wanted version number to be available in the
# a runtime.
#
# the code below assumes the distribution is being built with the
# current directory being the directory in which setup.py is stored
# which should be totally fine 99.9% of the time. not going to add
# the coode complexity to deal with other scenarios
#
reg_ex_pattern = r"__version__\s*=\s*['\"](?P<version>[^'\"]*)['\"]"
reg_ex = re.compile(reg_ex_pattern)
version = ""
with open("ecs/__init__.py", "r") as fd:
for line in fd:
match = reg_ex.match(line)
if match:
version = match.group("version")
break
if not version:
raise Exception('Can\'t locate project\'s version number')
setup(
name='ecs',
packages=[
'ecs',
],
scripts=[
'bin/ecservice.py',
],
install_requires=[
# using tornado.curl_httpclient.CurlAsyncHTTPClient
'pycurl>=7.19.5.1',
'semantic-version==2.6.0',
'tor-async-util==1.13.0',
'tornado==4.5.2',
],
include_package_data=True,
version=version,
description='Ephemeral Container Service',
author='Dave Simons',
author_email='simonsdave@gmail.com',
url='https://github.com/simonsdave/ecs',
)