fix(python-aiohttp): add python_dateutil to the generated requirements so dates are deserialized
The python-aiohttp server's generated util.deserialize_date() / deserialize_datetime() import dateutil and return the raw string on ImportError. Its generated requirements.txt and setup.py don't declare python_dateutil, and none of the declared dependencies pull it in. So in a fresh install, date / date-time model properties silently stay strings (for example Order.from_dict({'shipDate': ...}).ship_date is a str). python-flask already declares it (python_dateutil >= 2.6.0), and so does python-blueplanet.
Changes
python-aiohttp/requirements.mustacheandsetup.mustache: addpython_dateutil >= 2.6.0, in the same form and position as python-flask.- Regenerated
samples/server/petstore/python-aiohttp-srclayout(requirements.txt,setup.py).bin/configs/python-aiohttp.yamlis the python client withlibrary: asyncio; it already declarespython_dateutiland doesn't change. AbstractPythonConnexionServerCodegenTest: assert that both generated files contain the dependency.
Verification
Python*Test/AbstractPython*Testpass. The new test fails without the template change.- I created a fresh venv from the regenerated sample's
requirements.txtand installed the package.Order.from_dict({'shipDate': '2013-10-20T19:20:30+01:00'}).ship_dateis now adatetime. Before, without dateutil, it was the raw string.
PR checklist
- Read the contribution guidelines.
- Run the following to build the project and update samples:
Regenerated the samples for./mvnw clean package || exit ./bin/generate-samples.sh ./bin/configs/*.yaml || exit ./bin/utils/export_docs_generators.sh || exitbin/configs/python-aiohttp*.yamland committed the two changed files. Generator options and docs are unchanged. - If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
cc @cbornet @tomplus @krjakbrjak @fa0311 (Python technical committee)
Parts of this change were drafted with AI coding assistants (Devin, Claude Code, with reviews by Codex and Fable) and reviewed and verified by me.
š¤ Generated with Claude Code
Summary by cubic
Fixes the python-aiohttp server generator so date and date-time properties are actually deserialized instead of silently staying strings. The generated requirements.txt and setup.py now declare python_dateutil >= 2.6.0, matching python-flask, and the regenerated sample and a new codegen test assert the dependency is present.