zmievsa / pydantic-duality

Automatically and lazily generate three versions of your pydantic models: one with Extra.forbid, one with Extra.ignore, and one with all fields optional
https://ovsyanka83.github.io/pydantic-duality/
MIT License
31 stars 1 forks source link

Support Python 3.8 #11

Closed r4victor closed 6 months ago

r4victor commented 6 months ago

Closes #8

Tested on Python3.8-Python3.11.

Added explicit handling of List, Union types to make the tests pass. The proper handling of all such types should be handled in a separate issue #10.

zmievsa commented 6 months ago

I will take a closer look at this today.

r4victor commented 6 months ago

Thanks! I'm not sure what to do with the 100% coverage requirement. I wouldn't pursue it, but if it's a must, maybe you can assist with that.

zmievsa commented 6 months ago

I am afraid the 100% requirement is a must, yes. Essentially I have a rule both at work and in open source: whatever code the person writes must be covered by that same person in unit tests.

Do you need help with an idea for the test?

r4victor commented 6 months ago

@zmievsa Yes, I don't see a reasonable way to cover lines missing due to different runtime behavior of different Python versions (e.g. Annotated) or Python version branching.

zmievsa commented 6 months ago

Understood. In most of my projects, I combine the coverage from all CI runs, so 100% for different python versions is easily reachable.

I'll edit the CI in duality to match that too.

r4victor commented 6 months ago

FYI, the cumulative coverage (after running coverage combine) is 100%.

r4victor commented 5 months ago

@zmievsa, Python 3.8 support is critical for our project. We could depend on the commit in main but prefer to see a release with this PR. Any plans about the next release date?

zmievsa commented 5 months ago

I'll try to release it today.

zmievsa commented 5 months ago

Verified and published it.