-
-
Notifications
You must be signed in to change notification settings - Fork 437
Add GenerateConfig class and auto-generate TypedDicts for type-safe config #2844
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
076e228
Add GenerateConfig class and auto-generate TypedDicts for type-safe c…
koxudaxi cb34507
Add --unsafe-fixes to ruff-check formatter
koxudaxi 68fb0bd
Skip config-types hook in lint workflow
koxudaxi b3757ef
Fix UnionType serialization and skip tox-dependent hooks in lint CI
koxudaxi 59cb501
Revert --unsafe-fixes and exclude _types from pre-commit ruff
koxudaxi 389e47c
Regenerate config types after merging main
koxudaxi 313afc8
Remove UnionType handling (should be separate PR)
koxudaxi b95d4fc
Pin Python 3.14 for config-types CI
koxudaxi 11c5127
Remove unused _from_generate_config methods
koxudaxi 5a43cc3
Fix use_standard_collections merge logic
koxudaxi 3c36b64
Fix coverage omit pattern for _types directory
koxudaxi c12a383
Regenerate TypedDicts after merging set/frozenset fix
koxudaxi 8d05fb0
Add test for extra_template_data override and coverage pragmas
koxudaxi ead4e16
Restore --unsafe-fixes flag in ruff commands
koxudaxi 417ac76
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi ef68905
Restore _try_rebuild_model and test_input_model_config_class after merge
koxudaxi 445bc44
Use --input-model-ref-strategy to simplify config type generation
koxudaxi 51bfc28
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi c8d60ef
Regenerate config types with improved reuse-foreign strategy
koxudaxi 3230759
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi 5ac576b
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi 881c907
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi e1232b8
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi c308216
Remove WithJsonSchema annotations - automatic handling works
koxudaxi 6d513e8
Add tests to ensure Config and ConfigDict fields/types match
koxudaxi 1aff1b7
Add comprehensive Config/TypedDict compatibility tests
koxudaxi e44169b
Merge remote-tracking branch 'origin/main' into refactor/config-class
koxudaxi 78e492e
Use defaultdict for extra_template_data to match generate() signature
koxudaxi 1689892
Fix N806 lint: rename UnionMode variable to lowercase
koxudaxi abfc76c
Simplify type comparison tests for Config/TypedDict
koxudaxi 2104ed0
Add type comparison tests for Config/TypedDict equivalence
koxudaxi 9e89519
Fix formatting
koxudaxi b786adc
Skip Config/TypedDict tests on Pydantic v1
koxudaxi 6e861cd
Add default value tests for ParserConfig and ParseConfig
koxudaxi 87efda7
Use @PYDANTIC_V2_SKIP decorator for pydantic v2 tests
koxudaxi fba28c9
Fix type normalization for types.UnionType (Python 3.10+)
koxudaxi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Check config types | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'src/datamodel_code_generator/config.py' | ||
| - 'src/datamodel_code_generator/_types/**' | ||
| - 'pyproject.toml' | ||
| - '.github/workflows/config-types.yaml' | ||
| pull_request: | ||
| paths: | ||
| - 'src/datamodel_code_generator/config.py' | ||
| - 'src/datamodel_code_generator/_types/**' | ||
| - 'pyproject.toml' | ||
| - '.github/workflows/config-types.yaml' | ||
|
|
||
| jobs: | ||
| config-types: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - run: uv python install 3.14 | ||
|
|
||
| - run: uv tool install --python 3.14 tox --with tox-uv | ||
|
|
||
| - run: tox -e config-types -- --check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.