-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·108 lines (89 loc) · 3.49 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
104
105
106
107
108
#!/usr/bin/env python
# package: qtils
# licence: MIT <https://opensource.org/licenses/MIT>
# author: Daniel Kovacs <mondomhogynincsen@gmail.com>
# file: qtils/setup.py
# file-version: 2.2.1
# ---------------------------------------------------------------------------------------
# configuration
# ---------------------------------------------------------------------------------------
NAME = "qtils"
VERSION = "0.11.0"
DESCRIPTION = """Qtils - pronounces as `cuteels` - is a syntactic sugar library to make sweet Python coding even sweeter."""
AUTHOR = "Daniel Kovacs <@neonihil>"
AUTHOR_EMAIL = "mondomhogynincsen@gmail.com"
MAINTAINER = "Daniel Kovacs"
MAINTAINER_EMAIL = "mondomhogynincsen@gmail.com"
SCM_URL= "https://github.com/ultralightweight/qtils"
KEYWORDS = []
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries",
]
LICENCE="LGPLv3"
# ---------------------------------------------------------------------------------------
# imports
# ---------------------------------------------------------------------------------------
import codecs
import os
import re
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
# ---------------------------------------------------------------------------------------
# _read()
# ---------------------------------------------------------------------------------------
def _read(*parts):
with codecs.open(os.path.join(HOME, *parts), "rb", "utf-8") as f:
return f.read()
# ---------------------------------------------------------------------------------------
# get_requirements
# ---------------------------------------------------------------------------------------
def get_requirements():
packages, dependencies = [], []
for ir in parse_requirements(os.path.join( HOME, 'requirements.txt' ), session=False):
if ir.link:
dependencies.append(ir.link.url)
continue
packages.append(str(ir.req))
return packages, dependencies
# ---------------------------------------------------------------------------------------
# internal variables
# ---------------------------------------------------------------------------------------
HOME = os.path.abspath(os.path.dirname(__file__))
PACKAGES = find_packages(where='src')
INSTALL_REQUIRES, DEPENDENCY_LINKS = get_requirements()
# ---------------------------------------------------------------------------------------
# setup()
# ---------------------------------------------------------------------------------------
if __name__ == "__main__":
setup(
name=NAME,
description=DESCRIPTION,
license=LICENCE,
url=SCM_URL,
version=VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
keywords=KEYWORDS,
long_description=_read("README.rst"),
packages=PACKAGES,
package_dir={"": "src"},
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=INSTALL_REQUIRES,
dependency_links=DEPENDENCY_LINKS,
setup_requires=[
],
tests_require=[
'pytest',
],
)