-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsetup.py
More file actions
138 lines (122 loc) · 4.25 KB
/
Copy pathsetup.py
File metadata and controls
138 lines (122 loc) · 4.25 KB
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
#!/usr/bin/env python3
"""Setup script for GitHub Device Code Phishing Tool."""
import os
import sys
from pathlib import Path
from setuptools import setup, find_packages
# Ensure we're using Python 3.8+
if sys.version_info < (3, 8):
sys.exit("Python 3.8 or higher is required")
# Read the contents of README file
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding='utf-8')
# Read requirements from requirements.txt
def read_requirements(filename):
"""Read requirements from file, filtering out comments and empty lines."""
requirements = []
with open(filename, 'r', encoding='utf-8') as f:
for line in f:
line = line.strip()
if line and not line.startswith('#'):
# Remove version constraints for development dependencies
if any(dev_pkg in line for dev_pkg in ['pytest', 'black', 'flake8', 'mypy']):
continue
requirements.append(line)
return requirements
# Read version from __init__.py
def get_version():
"""Extract version from src/__init__.py."""
version_file = this_directory / "src" / "__init__.py"
if version_file.exists():
with open(version_file, 'r', encoding='utf-8') as f:
for line in f:
if line.startswith('__version__'):
return line.split('=')[1].strip().strip('"\'')
return "1.0.0"
# Package configuration
setup(
name="github-device-code-phishing",
version=get_version(),
author="Security Research Team",
author_email="security@your-org.com",
description="Advanced GitHub Device Code Phishing Tool with Web Interface",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/your-org/github-device-code-phishing",
project_urls={
"Bug Reports": "https://github.com/your-org/github-device-code-phishing/issues",
"Source": "https://github.com/your-org/github-device-code-phishing",
"Documentation": "https://github.com/your-org/github-device-code-phishing/tree/main/docs",
},
# Package discovery
packages=find_packages(where="src"),
package_dir={"": "src"},
# Include additional files
include_package_data=True,
package_data={
"": [
"web/templates/*.html",
"web/static/css/*.css",
"web/static/js/*.js",
"../config/*.json",
],
},
# Dependencies
install_requires=read_requirements("requirements.txt"),
# Optional dependencies
extras_require={
"dev": [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"pytest-asyncio>=0.21.0",
"black>=22.0.0",
"flake8>=5.0.0",
"mypy>=1.0.0",
"pre-commit>=2.20.0",
],
"docker": [
"gunicorn>=20.1.0",
"gevent>=22.10.0",
],
"performance": [
"aiohttp>=3.8.0",
"uvloop>=0.17.0; sys_platform != 'win32'",
],
},
# Entry points for CLI
entry_points={
"console_scripts": [
"github-phishing=cli:main",
"ghp=cli:main", # Short alias
],
},
# Metadata
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Information Technology",
"Topic :: Security",
"Topic :: Software Development :: Testing",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Environment :: Console",
"Environment :: Web Environment",
],
# Python version requirement
python_requires=">=3.8",
# Keywords for PyPI
keywords=[
"security", "penetration-testing", "red-team", "github",
"oauth", "device-code", "phishing", "social-engineering"
],
# License
license="MIT",
# Zip safety
zip_safe=False,
)