-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
57 lines (47 loc) · 1.28 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
"""
rio is a library for temporarily patching python objects so they are executed
by a remote server.
"""
import os
import re
from setuptools import setup, find_packages
_dirname = os.path.abspath(os.path.dirname(__file__))
def read(*paths):
with open(os.path.join(_dirname, *paths)) as f:
return f.read()
def version():
"""
Sources version from the __init__.py so we don't have to maintain the
value in two places.
"""
regex = re.compile(r'__version__ = \'([0-9.]+)\'')
for line in read('rio', '__init__.py').split('\n'):
match = regex.match(line)
if match:
return match.groups()[0]
def requirements():
"""
Sources install_requires from requirements.txt so we don't have to maintain
in two places.
"""
results = []
for line in read('requirements.txt').split('\n'):
line = line.strip()
if line.startswith('#'):
continue
results.append(line.split(' ')[0].split('#')[0])
return results
setup(
name='rio',
version=version(),
description=__doc__,
long_description=read('README.md'),
author='Sam Bourne',
packages=find_packages(),
install_requires=requirements(),
extras_require={
'tests': [
'pytest',
],
}
)