mirumee / ariadne-codegen

Generate fully typed Python client for any GraphQL API from schema, queries and mutations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add/keep Python 3.8 support

gst opened this issue · comments

Hi, I'm interrested in using the project but would need python3.8 support still.

But I've seen that the generated code has dict annotation. while python3.8 only supports Dict.

Would you be ok to still consider python3.8 support ?

Thx.

Hi, we're using ast.unparse to generate python code, it was introduced in 3.9, so that's the reason why we don't support < 3.9

I thought we already unified annotations to use Dict and not dict in generated code. I guess we missed 1 place.

So after this fix maybe you can use codegen with >= 3.9 and use generated package with 3.8. But we can't guarantee that this works or won't break in the future with next releases.

hi @mat-sop

yes I/we can use python>=3.9 (3.10 actually) to generate that python code still ok with python3.8, thanks effectively to the 1 place you found (had also changed it in my clone).

would you want me to make that patch/PR (though for 1 line I guess you could make it) ?

cheers,

@gst PR is very welcome, with this line changed to generate_name(DICT) the tests will also need to be updated.

@mat-sop made tentative here: #188

had to change a bit more than I was expecting. not sure all of them are actually required but so, yes, I used a search/replace at one moment ;)

all tests pass localy on my system at least.