-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
51 lines (39 loc) · 1.1 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import os
from setuptools import setup, find_packages
local_file = lambda *f: \
open(os.path.join(os.path.dirname(__file__), *f)).read()
class VersionFinder(ast.NodeVisitor):
VARIABLE_NAME = 'version'
def __init__(self):
self.version = None
def visit_Assign(self, node):
try:
if node.targets[0].id == self.VARIABLE_NAME:
self.version = node.value.s
except:
pass
def read_version():
finder = VersionFinder()
finder.visit(ast.parse(local_file('repocket', 'version.py')))
return finder.version
requirements = [
'redis==2.10.5',
'python-dateutil==2.4.2',
]
setup(
name='repocket',
version='0.1.29',
description='simple active record for redis',
entry_points={
'console_scripts': ['repocket = repocket.cli:main'],
},
author='Gabriel Falcao',
author_email='gabriel@nacaolivre.org',
url='https://repocket.readthedocs.io',
packages=find_packages(exclude=['*tests*']),
install_requires=requirements,
zip_safe=False,
)