-
-
Notifications
You must be signed in to change notification settings - Fork 7k
python: Reinstate lazy imports #21486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
thanks for the pr let me know if you need help updating the samples https://github.com/OpenAPITools/openapi-generator/actions/runs/15953926978/job/44997747683?pr=21486 |
@wing328 Done. |
thanks. will review and try to get it merged this weekend. is it correct to say you've used this fix in your production environment and it's working as expected? |
No. I have tested this of course but I'm currently not using openapi-generator in a production setting. I originally wanted this feature to generate usable bindings for the Kubernetes API (the official python client, which is based on a very old version of openapi-generator, is rather poorly maintained) but by now more comprehensive libraries exist. So I don't know whether I will actually need this feature for myself. I have the patch ready nonetheless. |
Maybe some of the other users who reported problems with long import times want to have a look. |
In my case, I experimented very hacky lazy imports but turned into hell dealing with LazyObject so I went with fopina/defectdojo-api-generated#21 Validate_call being the heaviest thing done during import time, I just removed all of them and living happily ever since! |
I'm happy to take a look, but can we clean up the change first? It touches it seems all the generators, although only the Python generator is (should be) changed. |
update: #21352 has been merged. thank you for your contribution. |
This PR now has a clean base. |
Addresses #19635, #18144
Depends on #21352
Critical commit: 94e39d6
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)@cbornet @tomplus @krjakbrjak @fa0311 @multani