Repository navigation
Support PYTHON_LAZY_IMPORTS=all (Python 3.15) - #1367
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 24 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Summary
After migrating my Django project to Python 3.15 I opted to run it with
PYTHON_LAZY_IMPORTS=all, turning lazy imports globally for all dependencies. Everything worked fine out of the box excepthttpx,httpx2andtruststore(which is fixed in git master).Easy way to reproduce:
The proposed solution here is unglamorous, but 1:1 compatible with the existing httpcore behavior. Alternative options:
isinstancechecks fortypes.LazyImportTypeand don't overwrite__module__if true__module__overwrites completely, as they are purely for aesthetic purposes, if I understand this code correctly (eg. it provides nicer looking type names in tracebacks)Checklist