datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

don't include `from __future__ import annotations` in the output when `target_python_version` is 3.14

Open DetachHead opened this issue 4 months ago • 2 comments

Is your feature request related to a problem? Please describe. __future__.annotations is no longer necessary as of python 3.14. see https://peps.python.org/pep-0749/#abstract

Describe the solution you'd like when target_python_version is 3.14, from __future__ import annotations shouldn't be included in the output

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

DetachHead avatar Oct 14 '25 02:10 DetachHead

Thanks for reporting the issue! As now, as far as I remember, the import is always added. Sometimes it can be avoided even for lower Python versions because its features are not always used.

Does it cause any issue to you, or is it just for cleanliness?

ilovelinux avatar Oct 17 '25 16:10 ilovelinux

just cleanliness

DetachHead avatar Oct 17 '25 16:10 DetachHead