@cryptotaxi247 / CoPilot / commits / a279fd0f

chore: drop 10 unused python deps + their orphan transitives (#842)

Removes packages with zero usage in the codebase, verified by source grep across app/, copilot.py, and alembic/. None of these are imported under their actual import names anywhere — including via dynamic imports, conditional imports, or test files. Removed top-level deps (10): - blueprint - libmagic (distinct from python-magic, no usage) - marshmallow-sqlalchemy (only marshmallow itself is used, pulled by environs) - openai (CoPilot's AI flow goes through Talon HTTP; OpenAI calls live in NanoClaw, not here) - pcre2 (only mention is a commented-out import) - pika (no AMQP/RabbitMQ paths in the app) - psycopg2-binary (app uses MySQL via aiomysql/pymysql) - python-jose (PyJWT is the actual JWT lib in use) - pytest (no test files exist in backend/) - mitreattack-python (already commented out in requirements.txt; cleaning up the stale .in entry) Removed orphan transitives (3 + pytest-playwright): - ecdsa (only python-jose depended on it) - iniconfig, pluggy (only pytest) - pytest-playwright (only depends on pytest) Kept that the first-pass grep flagged but verification rescued: - python-magic cortex4py requires it (pipdeptree --reverse) - playwright now promoted to an EXPLICIT dep (was pulled transitively by pytest-playwright). Used by app/connectors/grafana/services/reporting.py via `from playwright.async_api`. - elasticsearch7 imported as `elasticsearch7` (not `elasticsearch`) in 3 files - python-multipart not imported directly but required transitively by FastAPI File/Form/UploadFile Verified locally: - docker build of backend/Dockerfile succeeds - new image is ~1GB vs ~4.5GB on main (~77% smaller) - backend boots cleanly: alembic upgrade head, all seed funcs, APScheduler init, "Application startup complete" - all ~50 routers import without ModuleNotFoundError - `from playwright.async_api import async_playwright` succeeds - existing MySQL data unchanged (volume reused) Co-authored-by: taylor_socfortress <taylor.walton@socfortress.co> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

taylorcopilot committed May 7, 2026 at 14:30 UTC a279fd0f8f8e2146406b8db049b890bbf53ebe51
2 files changed +3 -23
backend/requirements.in
+1 -10
@@ -2,7 +2,6 @@ aiofiles
2 aiosqlite
3 apscheduler
4 bcrypt
5 -blueprint
5 cortex4py
6 elasticsearch7==7.10.1
7 environs
@@ -10,20 +9,12 @@ fastapi
9 grafana-client
10 httpx
11 influxdb-client[async]
13 -libmagic
12 loguru
15 -marshmallow-sqlalchemy
16 -mitreattack-python
17 -openai
13 passlib
14 passlib[bcrypt]
20 -pcre2
21 -pika
22 -psycopg2-binary
15 +playwright
16 pydantic[email]
17 PyJWT
25 -pytest
26 -python-jose[cryptography]
18 python-magic
19 python-multipart
20 pyvelociraptor~=0.1
backend/requirements.txt
+2 -13
@@ -17,7 +17,6 @@ asyncgelf==1.1.0
17 attrs==23.1.0
18 bcrypt==4.0.1
19 billiard==4.1.0
20 -blueprint==3.4.2
20 cattrs==23.1.2
21 #celery==5.3.4 removed due to python-dateutils==2.8.0 and i dont think we need this anyways
22 certifi==2023.7.22
@@ -40,7 +39,6 @@ Deprecated==1.2.14
39 dnspython==2.4.2
40 docxtpl==0.18.0
41 drawsvg==2.3.0
43 -ecdsa==0.18.0
42 elasticsearch7==7.10.1
43 email-validator==2.0.0.post2
44 environs==9.5.0
@@ -60,7 +58,6 @@ httpx==0.25.0
58 httpx[http2]==0.25.0
59 idna==3.4
60 influxdb-client==1.38.0
63 -iniconfig==2.0.0
61 isoduration==20.11.0
62 itsdangerous==2.1.2
63 Jinja2==3.1.2
@@ -69,7 +66,6 @@ jsonpointer==2.4
66 jsonschema==4.17.3
67 kiwisolver==1.4.5
68 kombu==5.3.2
72 -libmagic==1.0
69 licensing==0.43
70 loguru==0.7.2
71 #lxml==4.9.3 Bump down for python-docx
@@ -79,7 +75,6 @@ Markdown==3.4.4
75 markdown-it-py==3.0.0
76 MarkupSafe==2.1.3
77 marshmallow==3.20.1
82 -marshmallow-sqlalchemy==0.29.0
78 mdurl==0.1.2
79 miniopy-async==1.21.1
80 #mitreattack-python==2.0.14
@@ -87,7 +82,6 @@ mixbox==1.0.5
82 multidict==6.0.4
83 netaddr==0.9.0
84 numpy==1.26.0
90 -openai==0.28.1
85 openpyxl==3.1.2
86 ordered-set==4.1.0
87 orjson==3.9.9
@@ -96,18 +90,15 @@ packaging>=24.1,<25.0
90 #pandas==2.1.1 Had to drop to 1.3.5 which is compatible with python-dateutils==2.8.0 which is required by scoutsuite
91 #pandas==1.3.5
92 passlib==1.7.4
99 -pcre2==0.3.0
93 pdfkit==1.0.0
101 -pika==1.3.2
94 Pillow==10.0.1
95 pip==22.3.1
96 platformdirs==3.11.0
105 -pluggy==1.3.0
97 +playwright==1.39.0
98 pluralizer==1.2.0
99 pooch==1.7.0
100 prompt-toolkit==3.0.39
101 protobuf==4.24.4
110 -psycopg2-binary==2.9.9
102 pyasn1==0.5.0
103 pycountry==22.3.5
104 pycparser==2.21
@@ -115,6 +106,7 @@ pycparser==2.21
106 # pydantic_core==2.10.1
107 # pydantic-extra-types==2.1.0
108 # pydantic-settings==2.0.3
109 +pyee==11.0.1
110 Pygments==2.16.1
111 PyJWT==2.8.0
112 PyMySQL==1.1.0
@@ -122,11 +114,8 @@ pyotp==2.9.0
114 pyparsing==3.1.1
115 pyrsistent==0.19.3
116 pySigma==0.11.9
125 -pytest==7.4.2
126 -pytest-playwright==0.4.4
117 python-dateutil==2.8.0
118 python-dotenv==1.0.0
129 -python-jose==3.3.0
119 python-magic==0.4.27
120 python-multipart==0.0.6
121 pytz==2023.3.post1