Is your feature request related to a problem? Please describe.
Even with wolverdude/GenSON#73 fixed, datamodel-code-generator still depends on httpx, which is not yet supported in pyodide (see koenvo/pyodide-http#37)
Describe the solution you'd like
Replacing httpx with requests would solve this issue.
Beside some mockup patches in the tests, this is merly about two lines:
requests.get(url, headers=headers, verify=verify, allow_redirects=follow_redirects, params=params)
and
urllib.parse.urlparse
wrapped here: https://github.com/encode/httpx/blob/88a81c5d31a4a8b4bd0a860dedd3bb12dc09ff86/httpx/_urls.py#L370
see also https://github.com/search?q=repo%3Akoxudaxi%2Fdatamodel-code-generator%20httpx&type=code
Describe alternatives you've considered
As a temporary workaround, a patch is also possible:
import requests
import httpx
def patch_get(url, headers, verify, follow_redirects, params
):
return requests.get(
url, headers=headers, verify=verify, allow_redirects=follow_redirects, params=params
)
httpx.get = patch_get
Additional context
Patch solution is used here: https://oo-ld.github.io/playground-python-yaml/
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too