Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #16, Issue #6, plus some extra #18

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

whiskeyriver
Copy link

I went to fix this one line, and just saw some other stuff that might be a useful contribution so I added it.

@whiskeyriver
Copy link
Author

whiskeyriver commented Dec 8, 2024

when I went to create the PR I saw you fixed the cls.model_fields set within that same timespan, but I figured I'd open the PR anyway in case the other changes were useful to you.

I made the commits as targeted as possible so you can just cherrypick if you want.

Successful test matrix at https://github.com/whiskeyriver/djantic2/actions/runs/12226405204

@whiskeyriver whiskeyriver changed the title Fix for Issue #16, plus some extra Fix for Issue #16, Issue #6, plus some extra Dec 8, 2024
* Remove Python 3.8 (EOL) and add Python 3.13.
* Add tox matrix for Pydantic 2.8 - 2.10 (<2.8 is uninstallible via
  poetry)
* Update github actions/cache
* Always use `raise from` when reraising
* Don't use mutable objects as kwarg defaults
* Add missing assert to test case
Pydantic's json schema output changed after 2.8, eliminating the `allOf`
wrapping of a single `$ref` element.

See: pydantic/pydantic#10029

Here's a hacky way of ensuring tests run between these versions.
* Change `.dict()` to `.model_dump()`
* Change `@validator` to `@field_validator`
* Change the `Config` inner class to a `ConfigDict`
C405 Unnecessary `list` literal (rewrite as a `set` literal)
FactoryBoy is warning about not implicitly saving after post-generation.
This quiets those warnings since these post-generation hooks use
`create` explicitly.
Run the ruff linter over the code as configured by pyproject.toml.
@jonathan-s
Copy link
Owner

Thank you. I see some useful stuff here, so I will cherry pick some of it in due time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants