-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
54 lines (39 loc) · 1.47 KB
/
Copy pathsetup.py
File metadata and controls
54 lines (39 loc) · 1.47 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
import os
import itertools
from distutils.core import setup
here = os.path.abspath(os.path.dirname(__file__))
def get_version():
with open(os.path.join(here, 'chain_caller.py')) as f:
variables = {}
exec(f.read(), variables)
version = variables.get('__version__')
if version:
return version
raise RuntimeError('No version info found.')
def requirements_getter(filename):
result = []
with open(filename) as f:
requirements = map(lambda x: x.strip(), f.readlines())
for requirement in requirements:
if not requirement.startswith('-r'):
result.append(requirement)
continue
result += requirements_getter(
os.path.join(os.path.dirname(filename), requirement[2:].strip())
)
return result
__version__ = get_version()
setup(
name='px-chain-caller',
license='MIT',
version=__version__,
description='Simple utility for lazy call chain resolving',
long_description=open('README.md').read(),
author='Alex Tkachenko',
author_email='preusx.dev@gmail.com',
url='https://github.com/preusx/python-chain-caller',
download_url='https://github.com/preusx/python-chain-caller/archive/%s.tar.gz' % __version__,
py_modules=['chain_caller'],
install_requires=requirements_getter(os.path.join(here, 'requirements.txt')),
tests_require=requirements_getter(os.path.join(here, 'requirements/test.txt')),
)