-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
64 lines (51 loc) · 1.67 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
# !/usr/bin/env python
import os
from setuptools import setup
from typing import List
DESCRIPTION = 'CrowdStrike Foundry Function Software Developer Kit for Python'
PACKAGE_NAME = 'crowdstrike.foundry.function'
PACKAGE_DIR = {
'crowdstrike.foundry.function': './src/crowdstrike/foundry/function',
}
PACKAGES = [
'crowdstrike.foundry.function',
]
PYTHON_VERSION = '>=3.8.0'
SETUP_REQUIRES = [
'setuptools',
]
VERSION = '1.0.1'
def main():
setup(
description=DESCRIPTION,
install_requires=find_dependencies(os.path.join(os.path.dirname(__file__), "requirements.txt")),
name=PACKAGE_NAME,
package_dir=PACKAGE_DIR,
packages=PACKAGES,
python_requires=PYTHON_VERSION,
setup_requires=SETUP_REQUIRES,
version=VERSION,
long_description=long_description(),
long_description_content_type="text/markdown",
)
def find_dependencies(requirements) -> List[str]:
with open(requirements, 'r') as reqs:
return [line for line in sanitized_lines(reqs.readlines())]
def long_description() -> str:
with open("README.md", "r", encoding="utf-8") as fh:
descript = fh.read()
# 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:
descript = descript.replace(emoji, "")
return descript
def sanitized_lines(lines: List[str]):
for line in lines:
line = line.strip()
if line != '' and line[0] != '#':
yield line
if __name__ == "__main__":
main()