This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
89 lines (69 loc) · 1.95 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
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
NAME = 'schemapy'
KEYWORDS = 'schema api database'
DESC = 'Centralize database access'
URL = 'https://github.com/link-society/schemapy'
AUTHOR = 'Link Society'
AUTHOR_EMAIL = '[email protected]'
LICENSE = 'Apache'
REQUIREMENTS = [
'pyDAL>=17.11',
'addict>=2.1.2',
'pytest-runner>=3.0'
]
TESTS_REQUIREMENTS = [
'pytest>=3.4.0',
'python-decouple>=3.1'
]
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'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_test_suite():
return 'tests'
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(),
test_suite=get_test_suite(),
tests_require=TESTS_REQUIREMENTS,
install_requires=REQUIREMENTS,
classifiers=CLASSIFIERS,
)