/
setup.py
103 lines (79 loc) · 2.36 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
NAME = 'link.dbrequest'
KEYWORDS = 'link database request'
DESC = 'Database agnostic query system'
URL = 'https://github.com/linkdd/link.dbrequest'
AUTHOR = 'David Delassus'
AUTHOR_EMAIL = 'david.jose.delassus@gmail.com'
LICENSE = 'MIT'
REQUIREMENTS = [
'b3j0f.conf>=0.3.19',
'link.middleware>=1.5',
'link.feature>=2.1',
'six>=1.10.0',
'mock>=2.0.0'
]
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Topic :: Utilities',
'Topic :: Software Development :: Libraries :: Python Modules',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython'
]
def get_cwd():
return os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
def get_version(default='0.1'):
_name = NAME.replace('.', os.sep)
path = os.path.join(get_cwd(), _name, '__init__.py')
with open(path) as f:
stream = f.read()
regex = re.compile(r'.*__version__ = \'(.*?)\'', re.S)
version = regex.match(stream)
if version is None:
version = default
else:
version = version.group(1)
return version
def get_long_description():
path = os.path.join(get_cwd(), 'README.rst')
desc = None
if os.path.exists(path):
with open(path) as f:
desc = f.read()
return desc
def get_scripts():
path = os.path.join(get_cwd(), 'scripts')
scripts = []
if os.path.exists(path):
for root, _, files in os.walk(path):
for f in files:
scripts.append(os.path.join(root, f))
return scripts
def get_test_suite():
return 'link'
setup(
name=NAME,
keywords=KEYWORDS,
version=get_version(),
url=URL,
description=DESC,
long_description=get_long_description(),
license=LICENSE,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
packages=find_packages(),
scripts=get_scripts(),
test_suite=get_test_suite(),
install_requires=REQUIREMENTS,
classifiers=CLASSIFIERS
)