-
-
Notifications
You must be signed in to change notification settings - Fork 157
/
setup.py
executable file
·109 lines (91 loc) · 3.13 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
#!/usr/bin/env python
import os
import sys
from setuptools import Command, find_packages, setup
# Package meta-data.
NAME = "fsociety"
DESCRIPTION = "A Modular Penetration Testing Framework"
URL = "https://fsociety.dev/"
GIT_URL = "https://github.com/fsociety-team/fsociety"
PROJECT_URLS = {
"Packages": GIT_URL + "/blob/main/PACKAGES.md",
"Changelog": GIT_URL + "/blob/main/CHANGELOG.md",
"Funding": "https://github.com/sponsors/thehappydinoa",
"Tracker": GIT_URL + "/issues",
"Source": GIT_URL,
}
EMAIL = "[email protected]"
AUTHOR = "fsociety-team"
REQUIRES_PYTHON = ">=3.7.0"
VERSION = None
here = os.path.abspath(os.path.dirname(__file__))
pkg_vars = {} # type: ignore
with open(os.path.join(here, NAME, "__version__.py"), encoding="utf-8") as f:
exec(f.read(), pkg_vars)
try:
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = "\n" + f.read()
except FileNotFoundError:
long_description = DESCRIPTION
def get_requirements(path: str) -> list:
with open(path, encoding="utf-8") as f:
return f.read().splitlines()
class TagCommand(Command):
"""Support setup.py push_tag."""
description = "Push latest version as tag."
user_options = [] # type: ignore
@staticmethod
def status(s):
print(f"\033[1m{s}\033[0m")
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.status("Pushing git tags…")
os.system(f'git tag v{pkg_vars["__version__"]}')
os.system("git push --tags")
sys.exit()
setup(
name=NAME,
version=pkg_vars["__version__"],
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
project_urls=PROJECT_URLS,
packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
entry_points={
"console_scripts": ["fsociety=fsociety.__main__:main"],
},
install_requires=get_requirements("requirements.txt"),
extras_require={"dev": get_requirements("requirements-dev.txt")},
include_package_data=True,
license="MIT",
keywords=NAME,
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
"Topic :: Internet",
"Topic :: Security",
"Framework :: Flake8",
"Environment :: Console",
"Natural Language :: English",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: PyPy",
],
# python setup.py upload
cmdclass={"push_tag": TagCommand},
)