refactor(routes): move the email modules into routes/email/

routes/email_routes.py (7,194 lines), routes/email_helpers.py (2,025) and
routes/email_pollers.py (1,764) were the largest flat email area left in
routes/. They now live in routes/email/, following the pattern fifteen route
areas already use: the canonical module under the package, a shim at the old
path that replaces itself in sys.modules with the canonical object.

The shim matters more here than the move. Dozens of email tests monkeypatch
module attributes, and several pop the module from sys.modules and re-import
it. Without identity between routes.email_routes and routes.email.email_routes
those patches would apply to a different object than the app uses.

Intra-package imports keep the flat path, matching routes/document/ and
routes/gallery/: the shim resolves them and the diff stays a move.

Eight path references in five test modules read these files as source rather
than importing them, so they now read the canonical location. That is the same
adjustment every previous conversion made, and it is why the note/document
shims mention source-introspection tests explicitly.

No behaviour change. Verified with the full suite and under several explicit
collection orders, since a byte-identical routes move has broken tests under
one ordering before.
This commit is contained in:
Léo
2026-09-29 18:21:18 +02:00
parent 6105702901
commit 4b4ae592da
12 changed files with 11032 additions and 10976 deletions
+8
View File
@@ -0,0 +1,8 @@
"""Email route domain package.
Contains email_routes.py, email_helpers.py and email_pollers.py, migrated
from the flat routes/ directory. Backward-compat shims at
routes/email_routes.py, routes/email_helpers.py and routes/email_pollers.py
replace themselves with these modules, so both import paths resolve to one
object.
"""
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+11 -2020
View File
File diff suppressed because it is too large Load Diff
+11 -1759
View File
File diff suppressed because it is too large Load Diff
+11 -7189
View File
File diff suppressed because it is too large Load Diff