-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
145 lines (115 loc) · 3.41 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
"""
# -*- coding: utf-8 -*-
# ===============================================================================
#
# Copyright (C) 2013/2022 Laurent Labatut / Laurent Champagnac
#
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# ===============================================================================
"""
import re
from distutils.core import setup
from setuptools import find_packages
# ===========================
# TOOLS
# ===========================
def requirement_read(req_file):
"""
Doc
:param req_file: Doc
:return: Doc
"""
req_list = list()
with open(req_file, 'r') as f:
for rowBuffer in f.readlines():
# Skip empty
if len(rowBuffer.strip()) == 0:
continue
# Skip "- ..."
if re.match("^-", rowBuffer):
continue
# Skip "# ..."
if re.match("^#", rowBuffer):
continue
# Ok
req_list.append(rowBuffer)
return req_list
# ===========================
# SETUP
# ===========================
p_name = "knockdaemon2"
p_author = "Laurent Champagnac / Laurent Labatut"
p_email = "[email protected]"
p_url = "https://knock.center"
p_version = "3.7.1"
def entry_point_resolv():
"""
:return:
"""
ep = {
'console_scripts': [
'knockdaemon2 = knockdaemon2.Daemon.KnockDaemon:run',
]
}
return ep
def data_file_resolv():
"""
Data files
:return: list
:rtype: list
"""
datafile = [("",
[
"requirements_test.txt", "requirements.txt", "README.txt", "LICENSE.txt",
])]
return datafile
setup(
# Project details
name=p_name,
author=p_author,
author_email=p_email,
url=p_url,
description=p_name,
# Version, format : Major.Minor.Revision
version=p_version,
# Packages
packages=find_packages(exclude=["*_test*", "_*"]),
include_package_data=True,
# License & read me
license=open("LICENSE.txt").read(),
long_description=open("README.txt").read(),
# Data files
data_files=data_file_resolv(),
# Classifiers
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: GPLv2",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
],
# Dependencies
install_requires=requirement_read("requirements.txt"),
# Dependencies : test
tests_require=requirement_read("requirements_test.txt"),
# Entry points
entry_points=entry_point_resolv(),
# Disable egg zip format
zip_safe=False,
)