Skip to content

Commit a4d26d3

Browse files
committed
Merge branch 'main' into required-nullable-annotated
2 parents 40b418b + ac70785 commit a4d26d3

198 files changed

Lines changed: 10580 additions & 30311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codspeed.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ jobs:
2222
# https://github.com/astral-sh/uv/issues/11006
2323
- uses: actions/setup-python@v4
2424
with:
25-
python-version: "3.13"
25+
python-version: "3.14"
2626
- name: Install the latest version of uv
2727
uses: astral-sh/setup-uv@v5
2828
- name: Install dependencies
2929
run: uv sync --all-extras
3030
- name: Run benchmarks
31-
uses: CodSpeedHQ/action@v3
31+
uses: CodSpeedHQ/action@v4
3232
with:
3333
token: ${{ secrets.CODSPEED_TOKEN }}
3434
run: .venv/bin/pytest tests/ --codspeed -n auto
35+
mode: "instrumentation"

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
- tox_env: py3.12-black24
2929
- tox_env: py3.12-black23
3030
- tox_env: py3.12-black22
31+
- tox_env: py3.12-isort7
32+
- tox_env: py3.12-isort6
33+
- tox_env: py3.12-isort5
34+
- tox_env: py3.12-pydantic1
3135
runs-on: ${{ matrix.os == '' && 'ubuntu-24.04' || matrix.os }}
3236
env:
3337
OS: ${{ matrix.os == '' && 'ubuntu-24.04' || matrix.os}}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/python-jsonschema/check-jsonschema
3-
rev: 0.34.1
3+
rev: 0.35.0
44
hooks:
55
- id: check-github-workflows
66
args: [ "--verbose" ]
@@ -10,12 +10,12 @@ repos:
1010
- id: tox-ini-fmt
1111
args: ["-p", "fix"]
1212
- repo: https://github.com/tox-dev/pyproject-fmt
13-
rev: v2.11.0
13+
rev: v2.11.1
1414
hooks:
1515
- id: pyproject-fmt
1616
args: ["--max-supported-python=3.14"]
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: 'v0.14.2'
18+
rev: 'v0.14.6'
1919
hooks:
2020
- id: ruff-format
2121
exclude: "^tests/data"

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,11 @@ Typing customization:
380380
Set enum members as default values for enum field
381381
--strict-types {str,bytes,int,float,bool} [{str,bytes,int,float,bool} ...]
382382
Use strict types
383+
--type-mappings TYPE_MAPPINGS [TYPE_MAPPINGS ...]
384+
Override default type mappings. Format: "type+format=target" (e.g.,
385+
"string+binary=string" to map binary format to string type) or
386+
"format=target" (e.g., "binary=string"). Can be specified multiple
387+
times.
383388
--use-annotated Use typing.Annotated for Field(). Also, `--field-constraints` option
384389
will be enabled.
385390
--use-generic-container-types
@@ -391,10 +396,14 @@ Typing customization:
391396
corresponding con* constrained types.
392397
--use-one-literal-as-default
393398
Use one literal as default value for one literal field
399+
--use-specialized-enum, --no-use-specialized-enum
400+
Don''t use specialized Enum class (StrEnum, IntEnum) even if the
401+
target Python version supports it
394402
--use-standard-collections
395403
Use standard collections for type hinting (list, dict)
396-
--use-subclass-enum Define Enum class as subclass with field type when enum has type
397-
(int, float, bytes, str)
404+
--use-subclass-enum Define generic Enum class as subclass with field type when enum has
405+
type (int, float, bytes, str)
406+
--use-type-alias Use TypeAlias instead of root models (experimental)
398407
--use-union-operator Use | operator for Union type (PEP 604).
399408
--use-unique-items-as-set
400409
define field type as `set` when the field attribute has
@@ -433,6 +442,9 @@ Field customization:
433442
default values.
434443
--use-field-description
435444
Use schema description to populate field docstring
445+
--use-inline-field-description
446+
Use schema description to populate field docstring as inline
447+
docstring
436448

437449
Model customization:
438450
--allow-extra-fields Deprecated: Allow passing extra fields. This flag is deprecated. Use
@@ -518,6 +530,9 @@ General options:
518530
--debug show debug message (require "debug". `$ pip install ''datamodel-code-
519531
generator[debug]''`)
520532
--disable-warnings disable warnings
533+
--generate-pyproject-config
534+
Generate pyproject.toml configuration from the provided CLI
535+
arguments and exit
521536
--no-color disable colorized output
522537
--version show version
523538
-h, --help show this help message and exit

docs/index.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,11 @@ Typing customization:
372372
Set enum members as default values for enum field
373373
--strict-types {str,bytes,int,float,bool} [{str,bytes,int,float,bool} ...]
374374
Use strict types
375+
--type-mappings TYPE_MAPPINGS [TYPE_MAPPINGS ...]
376+
Override default type mappings. Format: "type+format=target" (e.g.,
377+
"string+binary=string" to map binary format to string type) or
378+
"format=target" (e.g., "binary=string"). Can be specified multiple
379+
times.
375380
--use-annotated Use typing.Annotated for Field(). Also, `--field-constraints` option
376381
will be enabled.
377382
--use-generic-container-types
@@ -383,10 +388,14 @@ Typing customization:
383388
corresponding con* constrained types.
384389
--use-one-literal-as-default
385390
Use one literal as default value for one literal field
391+
--use-specialized-enum, --no-use-specialized-enum
392+
Don''t use specialized Enum class (StrEnum, IntEnum) even if the
393+
target Python version supports it
386394
--use-standard-collections
387395
Use standard collections for type hinting (list, dict)
388-
--use-subclass-enum Define Enum class as subclass with field type when enum has type
389-
(int, float, bytes, str)
396+
--use-subclass-enum Define generic Enum class as subclass with field type when enum has
397+
type (int, float, bytes, str)
398+
--use-type-alias Use TypeAlias instead of root models (experimental)
390399
--use-union-operator Use | operator for Union type (PEP 604).
391400
--use-unique-items-as-set
392401
define field type as `set` when the field attribute has
@@ -425,6 +434,9 @@ Field customization:
425434
default values.
426435
--use-field-description
427436
Use schema description to populate field docstring
437+
--use-inline-field-description
438+
Use schema description to populate field docstring as inline
439+
docstring
428440

429441
Model customization:
430442
--allow-extra-fields Deprecated: Allow passing extra fields. This flag is deprecated. Use
@@ -510,6 +522,9 @@ General options:
510522
--debug show debug message (require "debug". `$ pip install ''datamodel-code-
511523
generator[debug]''`)
512524
--disable-warnings disable warnings
525+
--generate-pyproject-config
526+
Generate pyproject.toml configuration from the provided CLI
527+
arguments and exit
513528
--no-color disable colorized output
514529
--version show version
515530
-h, --help show this help message and exit

0 commit comments

Comments
 (0)