forked from CrowdStrike/falconpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_setup.py
162 lines (152 loc) · 6.78 KB
/
dev_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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
r"""
.---. .-----------
/ \ __ / ------
/ / \(..)/ -----
////// ' \/ ` ---
//// / // : : --- CrowdStrike
// / / /` '-- FalconPy
// //..\\
_.UU8888UU8lkoz.,_
d888888888888888888888b,
j88P""V8888888888888888888
888 8888888888888888888
888baed8888888888888888888
88888888888888888888888888
8888888888888
,ad8888888888888888888888888888888888 888888be,
d8888888888888888888888888888888888888 888888888b,
d88888888888888888888888888888888888888 8888888888b,
j888888888888888888888888888888888888888 88888888888p,
j888888888888888888888888888888888888888' 8888888888888
8888888888888888888888888888888888888^" ,8888888888888
88888888888888^' .d88888888888888
8888888888888" .a8888888888888888888888888888888888888
8888888888888 ,888888888888888888888888888888888888888^
^888888888888 888888888888888888888888888888888888888^
V88888888888 88888888888888888888888888888888888888Y
V8888888888 8888888888888888888888888888888888888Y
`"^8888888 8888888888888888888888888888888888^"'
8888888888888
88888888888888888888888888
8888888888888888888P""V888
8888888888888888888 888
8888888888888888888baed88V
`^888888888888888888888^
`'"^^V888888888V^^'
dev_setup.py - PyPI packaging utility for CrowdStrike FalconPy (Development Package)
"""
from glob import glob
from os.path import basename
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
from src.falconpy import _VERSION, _MAINTAINER, _TITLE, _DESCRIPTION, _AUTHOR
from src.falconpy import _AUTHOR_EMAIL, _PROJECT_URL, _DOCS_URL, _KEYWORDS
LOGO = []
LOGO.append("![Development Package]")
LOGO.append("(https://img.shields.io/badge/-Development%20Package-red?style=for-the-badge&")
LOGO.append("logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAABhWlD")
LOGO.append("Q1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw1AUhU9TpaIVBzuIOGSoDmJBVEQ3rUIRKoRaoVUHk5f+CE0akhQ")
LOGO.append("XR8G14ODPYtXBxVlXB1dBEPwBcXNzUnSREu9LCi1ifPB4H+e9c7jvXkColZhmtY0Cmm6bqURczGRXxN")
LOGO.append("AruhAEMI1hmVnGrCQl4bu+7hHg512MZ/m/+3N1qzmLAQGReIYZpk28Tjy5aRuc94kjrCirxOfEIyYVS")
LOGO.append("PzIdcXjN84FlwWeGTHTqTniCLFYaGGlhVnR1IgniKOqplO+kPFY5bzFWStVWKNO/sNwTl9e4jrtASSw")
LOGO.append("gEVIEKGggg2UYCNGp06KhRTdx338/a5fIpdCrg0wcsyjDA2y6wefwe/eWvnxMS8pHAfaXxznYxAI7QL")
LOGO.append("1quN8HztO/QQIPgNXetNfrgFTn6RXm1r0COjZBi6um5qyB1zuAH1PhmzKrsTnL+TzwPsZjSkL9N4Cna")
LOGO.append("te3xr3OH0A0tSr5A1wcAgMFSh7zeffHa19+/dNo38/hq9yr+iELI0AAAAGYktHRAAAAAAAAPlDu38AA")
LOGO.append("AAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQflDAsTByz7Va2cAAAAGXRFWHRDb21tZW50AENyZWF0")
LOGO.append("ZWQgd2l0aCBHSU1QV4EOFwAAAYBJREFUKM+lkjFIlVEYht/zn3sFkYYUyUnIRcemhCtCU6JQOLiIU+Q")
LOGO.append("eJEQg6BBIm0s4RBCBLjq5OEvgJC1uOniJhivesLx17/97/vO9b4NK4g25157hfHCGB773/cA0HZIEAK")
LOGO.append("iMj+LWiOxljG/i96pnCFP58XHnrWX2+9cj0dYl9Yu2FE9/9rXrcAAgs2eSyiBfOe/XRD503h/CuffOu")
LOGO.append("bQVUXL+Jh9BllzBbyJJBgDclVkO4Kukd8zzkXJbeUljIldFTstsmSHM6S81ma2KfPKlFdkGAMY4wzx/")
LOGO.append("bbXapMy21My+YizdKNq5mDzLkrxafSxySFKjSWX2oTmjKzz4vN0r2lOFcL/Q3V0/mX95ILMXTTGYVfa")
LOGO.append("ut/aP2+oCMAvnZgCcsF5fcR0dg65YHAdwB+QApADvu0AuOe/ftlJAD7Nsgmm6yBjDtfWORJZlNtFyo/")
LOGO.append("lR5Z7MyheKA5ktSur7sTAHazSG27pehjAiaVfkN8b4XFIJ/wOzbOx07VNRUuHy7w98CzCcGPyWywAAA")
LOGO.append("ABJRU5ErkJggg==)")
DEV_PACKAGE_LOGO = "".join(LOGO)
lines = []
with open("README.md", "r", encoding="utf-8") as desc_file:
for line in desc_file:
SRCH = "https://img.shields.io/pypi/status/crowdstrike-falconpy?label=package"
REPL = "https://img.shields.io/pypi/status/crowdstrike-falconpy-dev?label=package"
if SRCH in line:
line = line.replace(SRCH, REPL)
if "# FalconPy - The CrowdStrike Falcon SDK for Python" in line:
new_line = f"{line}\n{DEV_PACKAGE_LOGO}\n\n"
lines.append(new_line)
lines.append("> This is the development package.")
lines.append(" Please check https://pypi.org/project/crowdstrike-falconpy/")
lines.append(" for the stable release.\n\n")
else:
lines.append(line)
LONG_DESCRIPTION = "".join(lines)
project_title = f"{_TITLE}-dev"
# Remove GitHub's emoji
emojis = [
":speech_balloon: ", ":bulb: ", ":pray: ", ":raised_hands: ", " :fire:", ":fire: ",
"<small>", "</small>", " :mag_right:", " :dizzy:", " :memo:", " :coffee:", " :book:"
]
for emoji in emojis:
LONG_DESCRIPTION = LONG_DESCRIPTION.replace(emoji, "")
setup(
name=project_title,
version=_VERSION,
author=_AUTHOR,
author_email=_AUTHOR_EMAIL,
maintainer=_MAINTAINER,
maintainer_email=_AUTHOR_EMAIL,
docs_url=_DOCS_URL,
description=_DESCRIPTION,
keywords=_KEYWORDS,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
url=_PROJECT_URL,
project_urls={
"Documentation": "https://www.falconpy.io",
"Source": "https://github.com/CrowdStrike/falconpy/tree/dev/src/falconpy",
"Tracker": "https://github.com/CrowdStrike/falconpy/issues"
},
packages=find_packages("src"),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
install_requires=[
"requests",
"urllib3"
],
extras_require={
"dev": [
"flake8",
"coverage",
"pydocstyle",
"pylint",
"pytest-cov",
"pytest",
"bandit",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Framework :: Flake8",
"License :: OSI Approved :: The Unlicense (Unlicense)",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Systems Administration",
"Topic :: Utilities"
],
python_requires='>=3.6',
)