Skip to content

python: replace third-party lazy imports with the standard library#24402

Open
tamird wants to merge 2 commits into
OpenAPITools:masterfrom
tamird:fix/python-stdlib-lazy-imports
Open

python: replace third-party lazy imports with the standard library#24402
tamird wants to merge 2 commits into
OpenAPITools:masterfrom
tamird:fix/python-stdlib-lazy-imports

Conversation

@tamird

@tamird tamird commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Python's lazy-import mode currently depends on lazy-imports and replaces entries in sys.modules, introducing the supply-chain concern tracked in #21831.

Generate standard-library getattr and importlib-based exports instead. API and model modules still load on first access, with normal module metadata, type checking, cached public exports, and no third-party runtime dependency. https://peps.python.org/pep-0562/

@tamird

tamird commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@wing328 could you please take a look?

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant