-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·107 lines (89 loc) · 3.31 KB
/
setup.py
File metadata and controls
executable file
·107 lines (89 loc) · 3.31 KB
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
#!/usr/bin/env python
# package: qctrl_api
# licence: GPL3 <https://opensource.org/licenses/GPL3>
# author: Daniel Kovacs <danadeasysau@gmail.com>
# file: qctrl-api/setup.py
# file-version: 2.2.1
# ---------------------------------------------------------------------------------------
# configuration
# ---------------------------------------------------------------------------------------
NAME = "qctrl_api"
VERSION = "0.1.0"
DESCRIPTION = """Q-CTRL API"""
AUTHOR = "Daniel Kovacs"
AUTHOR_EMAIL = "danadeasysau@gmail.com"
MAINTAINER = "Daniel Kovacs"
MAINTAINER_EMAIL = "danadeasysau@gmail.com"
SCM_URL= ""
KEYWORDS = []
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: Other/Proprietary License"
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
]
# ---------------------------------------------------------------------------------------
# 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="License :: GPL3",
url=SCM_URL,
version=VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
keywords=KEYWORDS,
long_description=_read("README.md"),
include_package_data=True,
packages=PACKAGES,
package_dir={"": "src"},
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=INSTALL_REQUIRES,
dependency_links=DEPENDENCY_LINKS,
setup_requires=[
],
tests_require=[
'pytest',
],
)