-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·104 lines (94 loc) · 3.58 KB
/
setup.py
File metadata and controls
executable file
·104 lines (94 loc) · 3.58 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
"""setup.py for SPECTRA - Telegram Network Discovery & Archiving System
Builds and distributes SPECTRA as a single installable Python package.
For the best experience, use the bootstrap script:
./bootstrap
Or use the Makefile:
make bootstrap
For detailed setup instructions, see: docs/INSTALLATION_GUIDE.md
"""
from __future__ import annotations
from pathlib import Path
from setuptools import setup, find_packages
# ---------------------------------------------------------------------
# Version from package
# -----------------------------------------------------------------------
root = Path(__file__).parent
version = "1.0.0" # Default version
# Try to get version from package __init__.py
init_file = root / "tgarchive" / "__init__.py"
if init_file.exists():
for line in init_file.read_text().splitlines():
if line.startswith("__version__"):
try:
# Extract version from __version__ = "x.x.x" (ignoring comments)
version_part = line.split("=")[1].strip()
# Remove comment if present
version_part = version_part.split("#")[0].strip()
# Remove quotes
version = version_part.strip('"\'')
except (IndexError, ValueError):
pass
break
# ---------------------------------------------------------------------
# Helper for requirements
# ---------------------------------------------------------------------
def list_requirements() -> list[str]:
req_file = root / "requirements.txt"
if req_file.exists():
return [r.strip() for r in req_file.read_text().splitlines() if r.strip() and not r.startswith("#")]
# inline fallback
return [
"telethon>=1.34",
"rich>=13",
"tqdm>=4",
"pyyaml>=6",
"Pillow>=10",
"npyscreen>=4.10",
"jinja2>=3",
"networkx>=3.0",
"matplotlib>=3.6",
"pandas>=1.5",
"python-magic>=0.4.27",
"pyaes>=1.6.1",
"pyasn1>=0.6.0",
# "rsa>=4.9", # Removed: RSA is phased out per CNSA 2.0. Use ECC-based cryptography if needed.
"feedgen>=0.9.0",
"lxml>=4.9.2",
]
# ---------------------------------------------------------------------
# Long description from README
# ---------------------------------------------------------------------
long_description = (root / "README.md").read_text() if (root / "README.md").exists() else "SPECTRA archive toolkit."
# ---------------------------------------------------------------------
# Setup call
# ---------------------------------------------------------------------
setup(
name="spectra-archive",
version=version,
description="Telegram archiving & discovery toolkit (SPECTRA)",
long_description=long_description,
long_description_content_type="text/markdown",
author="John (SWORD-EPI)",
author_email="n/a",
url="https://github.com/SWORDIntel/SPECTRA002",
packages=find_packages(include=["tgarchive*"]),
install_requires=list_requirements(),
include_package_data=True,
license="MIT",
python_requires=">=3.10",
entry_points={
"console_scripts": [
"spectra = tgarchive.__main__:main",
],
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Topic :: Communications :: Chat",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Environment :: Console",
"Development Status :: 4 - Beta",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
],
)