refactor(routes): move cleanup domain into routes/cleanup/ subpackage (#5658)

Slice 2g of the route-domain reorganization (#4082/#4071). Moves
cleanup_routes.py into routes/cleanup/, leaving a backward-compat
sys.modules shim at the old path. Pure file reorganization, no behavior
change.

The shim uses sys.modules replacement so string-targeted
monkeypatch.setattr("routes.cleanup_routes.*", ...) in
test_cleanup_owner_scope.py reaches the canonical module.

Canonical module imports only from src/ and stdlib (zero internal
routes/ coupling). Zero source-introspection landmines.

Adds tests/test_cleanup_routes_shim.py to pin the sys.modules shim
contract. Verified: compileall clean; targeted tests pass.
This commit is contained in:
Tal.Yuan
2026-07-21 12:38:32 +02:00
committed by GitHub
parent cc4c7f4263
commit b7d3f2a28d
5 changed files with 104 additions and 57 deletions
+5
View File
@@ -0,0 +1,5 @@
"""Cleanup route domain package (slice 2g, #4082/#4071).
Contains cleanup_routes.py, migrated from the flat routes/ directory.
Backward-compat shim at routes/cleanup_routes.py re-exports from here.
"""