Repository navigation
Consolidate Python dependency versions into a single constraints file (unblock numpy 2.x + py3.13 in backend) #10524
Description
Activity
- addeddependenciesPull requests that update a dependency filePull requests that update a dependency file
on Jun 26, 2026 Task 1 complete → PR #10530. graspologic removed; community detection now uses NetworkX Louvain (zero new deps). Backend numpy<2 cap lifted (opencv <4.11 cap dropped) and the py3.13+ install blocker is gone. 31/31 mesh-brain tests pass. Tasks 2 (constraints/shared.txt single source of truth) and 3 (CI re-drift guard for portable/co-located roles) remain.
- added a commit that references this issue
on Jun 27, 2026 Tasks 2+3 complete → PR #10556.
constraints/shared.txtis now the single source of truth for numpy (declared in exactly one place; 7 requirements files reference it via-c). Addedscripts/check_constraint_drift.py+constraint-driftworkflow that fails any PR re-pinning a constrained package. With Task 1 (#10530) merged, all three tasks are done; umbrella ready for human close once #10556 lands.github-actions commented
on Jun 27, 2026 on Jun 27, 2026 – with GitHub ActionsContributorMore actions- added a commit that references this issue
on Jun 27, 2026 github-actions commented
on Jun 27, 2026 on Jun 27, 2026 – with GitHub ActionsContributorMore actionsComplete — all tasks merged
numpy is now declared in exactly one place repo-wide (
constraints/shared.txt); every requirements file references it via-c.Task PR Status 1 — Replace graspologic Leiden (unblock numpy 2.x + py3.13) #10530 merged 2 — constraints/shared.txtsingle source of truth#10556 merged 3 — constraint-driftCI guard#10556 merged Follow-up — wire requirements-ci/ai-ml.txt+ close guard glob gap#10562 merged Outcome: graspologic removed (was the sole numpy<2 / py3.13 backend blocker); backend, 6 worker/infra files, and the CI requirements all share one numpy pin (
>=2.5.0,<3.0.0);scripts/check_constraint_drift.py+ theconstraint-driftworkflow fail any PR that re-pins a constrained package — preventing the per-file drift that breaks pip when Ansible co-locates roles on one host.Closing as done.
- added a commit that references this issue
on Jul 6, 2026 - added a commit that references this issue
on Sep 23, 2026
Goal
Establish a single source of truth for shared/transitive Python dependency versions so every component installs the same, latest version of common libraries (numpy first), and bumping a version is a one-line change. Today numpy is pinned in 6 files with 3 different floors, and the backend is silently held a major version behind.
Why this matters now — portable roles
AutoBot roles (backend, tts-worker, npu-worker, ai-stack, code_analysis) are relocatable across hosts and can be co-located on one host by Ansible. When two roles with conflicting pins land in the same Python environment, pip cannot satisfy both. Version skew also breaks the array/serialization ABI when a
.npy/pickled embedding written by a numpy-2.x role is read by a numpy-1.x role. Single version is a co-location correctness requirement, not just hygiene.Current state (evidence)
numpy declared in 6 files, 3 different floors:
autobot-backend/code_analysis/requirements.txt:7numpy>=2.4.6,<3.0.0autobot-tts-worker/requirements.txt:6numpy>=2.5.0,<3.0.0autobot-npu-worker/requirements.txt:6numpy>=2.5.0,<3.0.0autobot-npu-worker/resources/windows-npu-worker/requirements.txt:60numpy>=2.4.3,<3.0.0autobot-infrastructure/shared/docker/ai-stack/requirements-ai.txt:25numpy>=2.5.0,<3.0.0autobot-infrastructure/autobot-npu-worker/docker/requirements-npu.txt:19numpy>=2.5.0,<3.0.0The main backend does NOT pin numpy directly; it is forced to numpy<2 transitively, via a constraint hidden on the opencv line (
autobot-backend/requirements.txt:42). No constraints file exists anywhere in the repo.Root cause / blocker
graspologic>=3.4.4(autobot-backend/requirements.txt:51) is a double blocker — latest stable 3.4.4 declares:So it caps the backend at numpy<2 and cannot install on Python 3.13+ (collides with the py3.14 migration). There is no numpy-2 graspologic release (even in dev). It is used in exactly one place — two
leiden(G, trials=N)calls inautobot-backend/services/mesh_brain/community_clusterer.py:52,93, over a networkx graph, returning{node: community_id}.Tasks
leiden()calls inservices/mesh_brain/community_clusterer.pyfor a numpy-2 + py3.13-compatible equivalent —leidenalg+python-igraph(true Leiden) ORnetworkx.community.louvain_communities(already a dep, no new package). Recommend leidenalg for algorithmic fidelity; confirm choice with board.{node: community_id}return contract + existing fallback/exception behavior; keepcluster_graph/_split_communitybehavior identical.graspologic>=3.4.4fromautobot-backend/requirements.txt; drop theopencv-python-headless<4.11cap (allow latest opencv / numpy>=2).constraints/shared.txtat repo root with one pin per shared lib (numpy==<latest>, scipy, opencv, etc.).-c <relpath>/constraints/shared.txt) and remove the per-file numpy version, leaving barenumpy.constraints/shared.txt(prevents re-drift).Verification
community_clusterertests pass with the new partitioner.