refactor(databus): move provider_chains.py to _generated package (P3B.6)
Move the auto-generated fallback chain definitions from app/databus/provider_chains.py to app/databus/_generated/provider_chains.py (underscore prefix = generated). The legacy app/databus/provider_chains.py becomes an 8-line re-export shim. Added scripts/generate_provider_chains.py to regenerate from the shim. Phase 3B of AUDIT-2026-Q3.md.
This commit is contained in:
parent
b33ad79dd2
commit
42739fb8ee
4 changed files with 1769 additions and 1721 deletions
7
app/databus/_generated/__init__.py
Normal file
7
app/databus/_generated/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
"""Auto-generated DataBus modules.
|
||||
|
||||
Phase 3B of AUDIT-2026-Q3.md.
|
||||
|
||||
Files in this package are generated from scripts (do not edit manually).
|
||||
Regenerate via scripts/generate_provider_chains.py.
|
||||
"""
|
||||
1723
app/databus/_generated/provider_chains.py
Normal file
1723
app/databus/_generated/provider_chains.py
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
33
scripts/generate_provider_chains.py
Executable file
33
scripts/generate_provider_chains.py
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Regenerate app.databus._generated.provider_chains.
|
||||
|
||||
Phase 3B of AUDIT-2026-Q3.md.
|
||||
|
||||
The generated file is checked into git so dev installs work offline.
|
||||
Re-run this script only when the chain topology changes (new data type,
|
||||
new provider, etc.).
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
SOURCE = Path("app/databus/provider_chains.py")
|
||||
TARGET = Path("app/databus/_generated/provider_chains.py")
|
||||
|
||||
|
||||
def main():
|
||||
TARGET.parent.mkdir(parents=True, exist_ok=True)
|
||||
content = SOURCE.read_text()
|
||||
header = (
|
||||
'"""\n'
|
||||
"AUTO-GENERATED by scripts/generate_provider_chains.py - DO NOT EDIT.\n"
|
||||
"\n"
|
||||
"Phase 3B of AUDIT-2026-Q3.md.\n"
|
||||
"Source: app/databus/provider_chains.py (legacy shim).\n"
|
||||
'"""\n'
|
||||
)
|
||||
body = content.split('"""', 2)[2] if '"""' in content else content
|
||||
TARGET.write_text(header + body)
|
||||
print("wrote {} ({} bytes)".format(TARGET, TARGET.stat().st_size))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue