30-Days-of-Python
30-Days-of-Python copied to clipboard
Bump pydantic from 1.4 to 1.6.2 in /tutorial-reference/Day 17
Bumps pydantic from 1.4 to 1.6.2.
Release notes
Sourced from pydantic's releases.
v1.6.2 (2021-05-11)
Security fix: Fix
dateanddatetimeparsing so passing either'infinity'orfloat('inf')(or their negative values) does not cause an infinite loop, see security advisory CVE-2021-29510.v1.6.1 (2020-07-15)
See Changelog.
Thank you to pydantic's sponsors:
@matin,@tiangolo,@chdsbd,@jorgecarleitao, and 1 anonymous sponsor for their kind support.changes:
- fix validation and parsing of nested models with
default_factory, #1710 by@PrettyWoodv1.6 (2020-07-11)
See Changelog.
Thank you to pydantic's sponsors:
@matin,@tiangolo,@chdsbd,@jorgecarleitao, and 1 anonymous sponsor for their kind support.changes:
- Modify validators for
conlistandconsetto not havealways=True, #1682 by@samuelcolvin- add port check to
AnyUrl(can't exceed 65536) ports are 16 insigned bits:0 <= port <= 2**16-1src: rfc793 header format, #1654 by@flapili- Document default
regexanchoring semantics, #1648 by@yurikhan- Use
chain.from_iterablein class_validators.py. This is a faster and more idiomatic way of usingitertools.chain. Instead of computing all the items in the iterable and storing them in memory, they are computed one-by-one and never stored as a huge list. This can save on both runtime and memory space, #1642 by@cool-RR- Add
conset(), analogous toconlist(), #1623 by@patrickkwang- make pydantic errors (un)pickable, #1616 by
@PrettyWood- Allow custom encoding for
dotenvfiles, #1615 by@PrettyWood- Ensure
SchemaExtraCallableis always defined to get type hints on BaseConfig, #1614 by@PrettyWood- Update datetime parser to support negative timestamps, #1600 by
@mlbiche- Update mypy, remove
AnyTypealias forType[Any], #1598 by@samuelcolvin- Adjust handling of root validators so that errors are aggregated from all failing root validators, instead of reporting on only the first root validator to fail, #1586 by
@beezee- Make
__modify_schema__on Enums apply to the enum schema rather than fields that use the enum, #1581 by@therefromhere- Fix behavior of
__all__key when used in conjunction with index keys in advanced include/exclude of fields that are sequences, #1579 by@xspirus- Subclass validators do not run when referencing a
Listfield defined in a parent class wheneach_item=True. Added an example to the docs illustrating this, #1566 by@samueldeklund- change
schema.field_class_to_schemato supportfrozensetin schema, #1557 by@wangpeibao- Call
__modify_schema__only for the field schema, #1552 by@PrettyWood- Move the assignment of
field.validate_alwaysinfields.pyso thealwaysparameter of validators work on inheritance, #1545 by@dcHHH- Added support for UUID instantiation through 16 byte strings such as
b'\x12\x34\x56\x78' * 4. This was done to supportBINARY(16)columns in sqlalchemy, #1541 by@shawnwall- Add a test assertion that
default_factorycan return a singleton, #1523 by@therefromhere- Add
NameEmail.__eq__so duplicateNameEmailinstances are evaluated as equal, #1514 by@stephen-bunn- Add datamodel-code-generator link in pydantic document site, #1500 by
@koxudaxi- Added a "Discussion of Pydantic" section to the documentation, with a link to "Pydantic Introduction" video by Alexander Hultnér, #1499 by
@hultner- Avoid some side effects of
default_factoryby calling it only once if possible and by not setting a default value in the schema, #1491 by@PrettyWood- Added docs about dumping dataclasses to JSON, #1487 by
@mikegrima- Make
BaseModel.__signature__class-only, so getting__signature__from model instance will raiseAttributeError, #1466 by@MrMrRobat- include
'format': 'password'in the schema for secret types, #1424 by@atheuz- Modify schema constraints on
ConstrainedFloatso thatexclusiveMinimumand minimum are not included in the schema if they are equal to-math.infandexclusiveMaximumandmaximumare not included if they are equal tomath.inf, #1417 by@vdwees- Squash internal
__root__dicts in.dict()(and, by extension, in.json()), #1414 by@patrickkwang
... (truncated)
Changelog
Sourced from pydantic's changelog.
v1.6.2 (2021-05-11)
- Security fix: Fix
dateanddatetimeparsing so passing either'infinity'orfloat('inf')(or their negative values) does not cause an infinite loop, See security advisory CVE-2021-29510v1.6.1 (2020-07-15)
- fix validation and parsing of nested models with
default_factory, #1710 by@PrettyWoodv1.6 (2020-07-11)
Thank you to pydantic's sponsors:
@matin,@tiangolo,@chdsbd,@jorgecarleitao, and 1 anonymous sponsor for their kind support.
- Modify validators for
conlistandconsetto not havealways=True, #1682 by@samuelcolvin- add port check to
AnyUrl(can't exceed 65536) ports are 16 insigned bits:0 <= port <= 2**16-1src: rfc793 header format, #1654 by@flapili- Document default
regexanchoring semantics, #1648 by@yurikhan- Use
chain.from_iterablein class_validators.py. This is a faster and more idiomatic way of usingitertools.chain. Instead of computing all the items in the iterable and storing them in memory, they are computed one-by-one and never stored as a huge list. This can save on both runtime and memory space, #1642 by@cool-RR- Add
conset(), analogous toconlist(), #1623 by@patrickkwang- make pydantic errors (un)pickable, #1616 by
@PrettyWood- Allow custom encoding for
dotenvfiles, #1615 by@PrettyWood- Ensure
SchemaExtraCallableis always defined to get type hints on BaseConfig, #1614 by@PrettyWood- Update datetime parser to support negative timestamps, #1600 by
@mlbiche- Update mypy, remove
AnyTypealias forType[Any], #1598 by@samuelcolvin- Adjust handling of root validators so that errors are aggregated from all failing root validators, instead of reporting on only the first root validator to fail, #1586 by
@beezee- Make
__modify_schema__on Enums apply to the enum schema rather than fields that use the enum, #1581 by@therefromhere- Fix behavior of
__all__key when used in conjunction with index keys in advanced include/exclude of fields that are sequences, #1579 by@xspirus- Subclass validators do not run when referencing a
Listfield defined in a parent class wheneach_item=True. Added an example to the docs illustrating this, #1566 by@samueldeklund- change
schema.field_class_to_schemato supportfrozensetin schema, #1557 by@wangpeibao- Call
__modify_schema__only for the field schema, #1552 by@PrettyWood- Move the assignment of
field.validate_alwaysinfields.pyso thealwaysparameter of validators work on inheritance, #1545 by@dcHHH- Added support for UUID instantiation through 16 byte strings such as
b'\x12\x34\x56\x78' * 4. This was done to supportBINARY(16)columns in sqlalchemy, #1541 by@shawnwall- Add a test assertion that
default_factorycan return a singleton, #1523 by@therefromhere- Add
NameEmail.__eq__so duplicateNameEmailinstances are evaluated as equal, #1514 by@stephen-bunn- Add datamodel-code-generator link in pydantic document site, #1500 by
@koxudaxi- Added a "Discussion of Pydantic" section to the documentation, with a link to "Pydantic Introduction" video by Alexander Hultnér, #1499 by
@hultner- Avoid some side effects of
default_factoryby calling it only once if possible and by not setting a default value in the schema, #1491 by@PrettyWood- Added docs about dumping dataclasses to JSON, #1487 by
@mikegrima- Make
BaseModel.__signature__class-only, so getting__signature__from model instance will raiseAttributeError, #1466 by@MrMrRobat- include
'format': 'password'in the schema for secret types, #1424 by@atheuz- Modify schema constraints on
ConstrainedFloatso thatexclusiveMinimumand minimum are not included in the schema if they are equal to-math.infandexclusiveMaximumandmaximumare not included if they are equal tomath.inf, #1417 by@vdwees- Squash internal
__root__dicts in.dict()(and, by extension, in.json()), #1414 by@patrickkwang- Move
constvalidator to post-validators so it validates the parsed value, #1410 by@selimb- Fix model validation to handle nested literals, e.g.
Literal['foo', Literal['bar']], #1364 by@DBCerigo- Remove
user_required = TruefromRedisDsn, neither user nor password are required, #1275 by@samuelcolvin
... (truncated)
Commits
acf7783tweak history829528ccomment out broken testscf9a417hack tests into passingb37a922fix formattingac360c5prepare for releasebdde15bMerge pull request from GHSA-5jqp-qgf6-3pvhd2b0501upreve2fcab5fix: validate and parse nested models properly withdefault_factory(#1712)ba56a67Bump pytest-mock from 3.1.1 to 3.2.0 (#1719)f1f944fUpdate datamode_code_generator:typo in pip install (#1713)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labelswill set the current labels as the default for future PRs for this repo and language@dependabot use these reviewerswill set the current reviewers as the default for future PRs for this repo and language@dependabot use these assigneeswill set the current assignees as the default for future PRs for this repo and language@dependabot use this milestonewill set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the Security Alerts page.