-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
125 lines (105 loc) · 3.48 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
"""
# -*- coding: utf-8 -*-
# ===============================================================================
#
# Copyright (C) 2013/2018 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
# ===============================================================================
"""
from distutils.core import setup
import re
from setuptools import find_packages
def requirement_read(req_file):
"""
Doc
:param req_file: Doc
:return: Doc
"""
local_req_list = list()
local_dep_list = list()
for row_buffer in open(req_file).readlines():
# Skip empty
if len(row_buffer.strip()) == 0:
continue
# Skip "- ..."
elif re.match("^-", row_buffer):
continue
# Skip "# ..."
elif re.match("^#", row_buffer):
continue
# Git stuff (direct)
# From : https://github.com/pypa/pip/issues/3610#issuecomment-356687173
elif re.match("^git", row_buffer):
pkg = row_buffer.split('#')[-1]
local_dep_list.append(row_buffer.strip() + '-9876543210')
local_req_list.append(pkg.replace('egg=', '').rstrip())
else:
# Ok
local_req_list.append(row_buffer)
return local_req_list, local_dep_list
# ===========================
# SETUP
# ===========================
p_name = "pysolbase"
p_author = "Laurent Champagnac"
p_email = "champagnac.laurent@gmail.com"
p_url = "https://knock.center"
p_version = "3.11.0"
# Load
req_list, dep_list = requirement_read("requirements.txt")
test_req_list, _ = requirement_read("requirements_test.txt")
setup(
# Project details
name=p_name,
author=p_author,
author_email=p_email,
url=p_url,
description="Set of python helpers to ease development",
# Version, format : Major.Minor.Revision
version=p_version,
# Packages
packages=find_packages(exclude=["*_test*", "_*"]),
include_package_data=True,
# License & read me
license="GPLv3",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
# Data files
data_files=[
("", ["requirements_test.txt", "requirements.txt", "README.md", "LICENSE.md"]),
],
# Classifiers
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries",
"Natural Language :: English",
],
# Dependencies
install_requires=req_list,
# Direct deps
dependency_links=dep_list,
# Dependencies : test
tests_require=test_req_list,
# Zip
zip_safe=False,
)