pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-dantic: update to 1.8.2.



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <tk%giga.or.at@localhost>
Pushed By:	wiz
Date:		Thu Nov 25 12:37:31 2021 +0100
Changeset:	dfce247efb30baf67ea73195cacc0d83c546cc87

Modified Files:
	py-dantic/DESCR
	py-dantic/Makefile
	py-dantic/PLIST
	py-dantic/distinfo
Removed Files:
	py-dantic/TODO

Log Message:
py-dantic: update to 1.8.2.

!!! warning
    A security vulnerability, level "moderate" is fixed in v1.8.2. Please upgrade **ASAP**.
    See security advisory [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)

* **Security fix:** Fix `date` and `datetime` parsing so passing either `'infinity'` or `float('inf')`
  (or their negative values) does not cause an infinite loop,
  see security advisory [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)
* fix schema generation with Enum by generating a valid name, #2575 by @PrettyWood
* fix JSON schema generation with a `Literal` of an enum member, #2536 by @PrettyWood
* Fix bug with configurations declarations that are passed as
  keyword arguments during class creation, #2532 by @uriyyo
* Allow passing `json_encoders` in class kwargs, #2521 by @layday
* support arbitrary types with custom `__eq__`, #2483 by @PrettyWood
* support `Annotated` in `validate_arguments` and in generic models with python 3.9, #2483 by @PrettyWood
* Support user defined generic field types in generic models, #2465 by @daviskirk

Bug fixes for regressions and new features from `v1.8`

* allow elements of `Config.field` to update elements of a `Field`, #2461 by @samuelcolvin
* fix validation with a `BaseModel` field and a custom root type, #2449 by @PrettyWood
* expose `Pattern` encoder to `fastapi`, #2444 by @PrettyWood
* enable the Hypothesis plugin to generate a constrained float when the `multiple_of` argument is specified, #2442 by @tobi-lipede-oodle
* Avoid `RecursionError` when using some types like `Enum` or `Literal` with generic models, #2436 by @PrettyWood
* do not overwrite declared `__hash__` in subclasses of a model, #2422 by @PrettyWood
* fix `mypy` complaints on `Path` and `UUID` related custom types, #2418 by @PrettyWood
* Support properly variable length tuples of compound types, #2416 by @PrettyWood

* [Hypothesis plugin](https://pydantic-docs.helpmanual.io/hypothesis_plugin/) for testing, #2097 by @Zac-HD
* support for [`NamedTuple` and `TypedDict`](https://pydantic-docs.helpmanual.io/usage/types/#annotated-types), #2216 by @PrettyWood
* Support [`Annotated` hints on model fields](https://pydantic-docs.helpmanual.io/usage/schema/#typingannotated-fields), #2147 by @JacobHayes
* [`frozen` parameter on `Config`](https://pydantic-docs.helpmanual.io/usage/model_config/) to allow models to be hashed, #1880 by @rhuille

* **Breaking Change**, remove old deprecation aliases from v1, #2415 by @samuelcolvin:
  * remove notes on migrating to v1 in docs
  * remove `Schema` which was replaced by `Field`
  * remove `Config.case_insensitive` which was replaced by `Config.case_sensitive` (default `False`)
  * remove `Config.allow_population_by_alias` which was replaced by `Config.allow_population_by_field_name`
  * remove `model.fields` which was replaced by `model.__fields__`
  * remove `model.to_string()` which was replaced by `str(model)`
  * remove `model.__values__` which was replaced by `model.__dict__`
* **Breaking Change:** always validate only first sublevel items with `each_item`.
  There were indeed some edge cases with some compound types where the validated items were the last sublevel ones, #1933 by @PrettyWood
* Update docs extensions to fix local syntax highlighting, #2400 by @daviskirk
* fix: allow `utils.lenient_issubclass` to handle `typing.GenericAlias` objects like `list[str]` in python >= 3.9, #2399 by @daviskirk
* Improve field declaration for _pydantic_ `dataclass` by allowing the usage of _pydantic_ `Field` or `'metadata'` kwarg of `dataclasses.field`, #2384 by @PrettyWood
* Making `typing-extensions` a required dependency, #2368 by @samuelcolvin
* Make `resolve_annotations` more lenient, allowing for missing modules, #2363 by @samuelcolvin
* Allow configuring models through class kwargs, #2356 by @MrMrRobat
* Prevent `Mapping` subclasses from always being coerced to `dict`, #2325 by @ofek
* fix: allow `None` for type `Optional[conset / conlist]`, #2320 by @PrettyWood
* Support empty tuple type, #2318 by @PrettyWood
* fix: `python_requires` metadata to require >=3.6.1, #2306 by @hukkinj1
* Properly encode `Decimal` with, or without any decimal places, #2293 by @hultner
* fix: update `__fields_set__` in `BaseModel.copy(update=…)`, #2290 by @PrettyWood
* fix: keep order of fields with `BaseModel.construct()`, #2281 by @PrettyWood
* Support generating schema for Generic fields, #2262 by @maximberg
* Fix `validate_decorator` so `**kwargs` doesn't exclude values when the keyword
  has the same name as the `*args` or `**kwargs` names, #2251 by @cybojenix
* Prevent overriding positional arguments with keyword arguments in
  `validate_arguments`, as per behaviour with native functions, #2249 by @cybojenix
* add documentation for `con*` type functions, #2242 by @tayoogunbiyi
* Support custom root type (aka `__root__`) when using `parse_obj()` with nested models, #2238 by @PrettyWood
* Support custom root type (aka `__root__`) with `from_orm()`, #2237 by @PrettyWood
* ensure cythonized functions are left untouched when creating models, based on #1944 by @kollmats, #2228 by @samuelcolvin
* Resolve forward refs for stdlib dataclasses converted into _pydantic_ ones, #2220 by @PrettyWood
* Add support for `NamedTuple` and `TypedDict` types.
  Those two types are now handled and validated when used inside `BaseModel` or _pydantic_ `dataclass`.
  Two utils are also added `create_model_from_namedtuple` and `create_model_from_typeddict`, #2216 by @PrettyWood
* Do not ignore annotated fields when type is `Union[Type[...], ...]`, #2213 by @PrettyWood
* Raise a user-friendly `TypeError` when a `root_validator` does not return a `dict` (e.g. `None`), #2209 by @masalim2
* Add a `FrozenSet[str]` type annotation to the `allowed_schemes` argument on the `strict_url` field type, #2198 by @Midnighter
* add `allow_mutation` constraint to `Field`, #2195 by @sblack-usu
* Allow `Field` with a `default_factory` to be used as an argument to a function
  decorated with `validate_arguments`, #2176 by @thomascobb
* Allow non-existent secrets directory by only issuing a warning, #2175 by @davidolrik
* fix URL regex to parse fragment without query string, #2168 by @andrewmwhite
* fix: ensure to always return one of the values in `Literal` field type, #2166 by @PrettyWood
* Support `typing.Annotated` hints on model fields. A `Field` may now be set in the type hint with `Annotated[..., Field(...)`; all other annotations are ignored but still visible with `get_type_hints(..., include_extras=True)`, #2147 by @JacobHayes
* Added `StrictBytes` type as well as `strict=False` option to `ConstrainedBytes`, #2136 by @rlizzo
* added `Config.anystr_lower` and `to_lower` kwarg to `constr` and `conbytes`, #2134 by @tayoogunbiyi
* Support plain `typing.Tuple` type, #2132 by @PrettyWood
* Add a bound method `validate` to functions decorated with `validate_arguments`
  to validate parameters without actually calling the function, #2127 by @PrettyWood
* Add the ability to customize settings sources (add / disable / change priority order), #2107 by @kozlek
* Fix mypy complaints about most custom _pydantic_ types, #2098 by @PrettyWood
* Add a [Hypothesis](https://hypothesis.readthedocs.io/) plugin for easier [property-based testing](https://increment.com/testing/in-praise-of-property-based-testing/) with Pydantic's custom types - [usage details here](https://pydantic-docs.helpmanual.io/hypothesis_plugin/), #2097 by @Zac-HD
* add validator for `None`, `NoneType` or `Literal[None]`, #2095 by @PrettyWood
* Handle properly fields of type `Callable` with a default value, #2094 by @PrettyWood
* Updated `create_model` return type annotation to return type which inherits from `__base__` argument, #2071 by @uriyyo
* Add merged `json_encoders` inheritance, #2064 by @art049
* allow overwriting `ClassVar`s in sub-models without having to re-annotate them, #2061 by @layday
* add default encoder for `Pattern` type, #2045 by @PrettyWood
* Add `NonNegativeInt`, `NonPositiveInt`, `NonNegativeFloat`, `NonPositiveFloat`, #1975 by @mdavis-xyz
* Use % for percentage in string format of colors, #1960 by @EdwardBetts
* Fixed issue causing `KeyError` to be raised when building schema from multiple `BaseModel` with the same names declared in separate classes, #1912 by @JSextonn
* Add `rediss` (Redis over SSL) protocol to `RedisDsn`
  Allow URLs without `user` part (e.g., `rediss://:pass@localhost`), #1911 by @TrDex
* Add a new `frozen` boolean parameter to `Config` (default: `False`).
  Setting `frozen=True` does everything that `allow_mutation=False` does, and also generates a `__hash__()` method for the model. This makes instances of the model potentially hashable if all the attributes are hashable, #1880 by @rhuille
* fix schema generation with multiple Enums having the same name, #1857 by @PrettyWood
* Added support for 13/19 digits VISA credit cards in `PaymentCardNumber` type, #1416 by @AlexanderSov
* fix: prevent `RecursionError` while using recursive `GenericModel`s, #1370 by @xppt
* use `enum` for `typing.Literal` in JSON schema, #1350 by @PrettyWood
* Fix: some recursive models did not require `update_forward_refs` and silently behaved incorrectly, #1201 by @PrettyWood
* Fix bug where generic models with fields where the typevar is nested in another type `a: List[T]` are considered to be concrete. This allows these models to be subclassed and composed as expected, #947 by @daviskirk
* Add `Config.copy_on_model_validation` flag. When set to `False`, _pydantic_ will keep models used as fields
  untouched on validation instead of reconstructing (copying) them, #265 by @PrettyWood

* **Security fix:** Fix `date` and `datetime` parsing so passing either `'infinity'` or `float('inf')`
  (or their negative values) does not cause an infinite loop,
  See security advisory [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)

* fix: set right default value for required (optional) fields, #2142 by @PrettyWood
* fix: support `underscore_attrs_are_private` with generic models, #2138 by @PrettyWood
* fix: update all modified field values in `root_validator` when `validate_assignment` is on, #2116 by @PrettyWood
* Allow pickling of `pydantic.dataclasses.dataclass` dynamically created from a built-in `dataclasses.dataclass`, #2111 by @aimestereo
* Fix a regression where Enum fields would not propagate keyword arguments to the schema, #2109 by @bm424
* Ignore `__doc__` as private attribute when `Config.underscore_attrs_are_private` is set, #2090 by @PrettyWood

* fix slow `GenericModel` concrete model creation, allow `GenericModel` concrete name reusing in module, #2078 by @MrMrRobat
* keep the order of the fields when `validate_assignment` is set, #2073 by @PrettyWood
* forward all the params of the stdlib `dataclass` when converted into _pydantic_ `dataclass`, #2065 by @PrettyWood

* fix annotation of `validate_arguments` when passing configuration as argument, #2055 by @layday
* Fix mypy assignment error when using `PrivateAttr`, #2048 by @aphedges
* fix `underscore_attrs_are_private` causing `TypeError` when overriding `__init__`, #2047 by @samuelcolvin
* Fixed regression introduced in v1.7 involving exception handling in field validators when `validate_assignment=True`, #2044 by @johnsabath
* fix: _pydantic_ `dataclass` can inherit from stdlib `dataclass`
  and `Config.arbitrary_types_allowed` is supported, #2042 by @PrettyWood

* python 3.9 support, thanks @PrettyWood
* [Private model attributes](https://pydantic-docs.helpmanual.io/usage/models/#private-model-attributes), thanks @MrMrRobat
* ["secrets files" support in `BaseSettings`](https://pydantic-docs.helpmanual.io/usage/settings/#secret-support), thanks @mdgilene
* [convert stdlib dataclasses to pydantic dataclasses and use stdlib dataclasses in models](https://pydantic-docs.helpmanual.io/usage/dataclasses/#stdlib-dataclasses-and-pydantic-dataclasses), thanks @PrettyWood

* **Breaking Change:** remove `__field_defaults__`, add `default_factory` support with `BaseModel.construct`.
  Use `.get_default()` method on fields in `__fields__` attribute instead, #1732 by @PrettyWood
* Rearrange CI to run linting as a separate job, split install recipes for different tasks, #2020 by @samuelcolvin
* Allows subclasses of generic models to make some, or all, of the superclass's type parameters concrete, while
  also defining new type parameters in the subclass, #2005 by @choogeboom
* Call validator with the correct `values` parameter type in `BaseModel.__setattr__`,
  when `validate_assignment = True` in model config, #1999 by @me-ransh
* Force `fields.Undefined` to be a singleton object, fixing inherited generic model schemas, #1981 by @daviskirk
* Include tests in source distributions, #1976 by @sbraz
* Add ability to use `min_length/max_length` constraints with secret types, #1974 by @uriyyo
* Also check `root_validators` when `validate_assignment` is on, #1971 by @PrettyWood
* Fix const validators not running when custom validators are present, #1957 by @hmvp
* add `deque` to field types, #1935 by @wozniakty
* add basic support for python 3.9, #1832 by @PrettyWood
* Fix typo in the anchor of exporting_models.md#modelcopy and incorrect description, #1821 by @KimMachineGun
* Added ability for `BaseSettings` to read "secret files", #1820 by @mdgilene
* add `parse_raw_as` utility function, #1812 by @PrettyWood
* Support home directory relative paths for `dotenv` files (e.g. `~/.env`), #1803 by @PrettyWood
* Clarify documentation for `parse_file` to show that the argument
  should be a file *path* not a file-like object, #1794 by @mdavis-xyz
* Fix false positive from mypy plugin when a class nested within a `BaseModel` is named `Model`, #1770 by @selimb
* add basic support of Pattern type in schema generation, #1767 by @PrettyWood
* Support custom title, description and default in schema of enums, #1748 by @PrettyWood
* Properly represent `Literal` Enums when `use_enum_values` is True, #1747 by @noelevans
* Allows timezone information to be added to strings to be formatted as time objects. Permitted formats are `Z` for UTC
  or an offset for absolute positive or negative time shifts. Or the timezone data can be omitted, #1744 by @noelevans
* Add stub `__init__` with python 3.6 signature for `ForwardRef`, #1738 by @sirtelemak
* Fix behaviour with forward refs and optional fields in nested models, #1736 by @PrettyWood
* add `Enum` and `IntEnum` as valid types for fields, #1735 by @PrettyWood
* Change default value of `__module__` argument of `create_model` from `None` to `'pydantic.main'`.
  Set reference of created concrete model to it's module to allow pickling (not applied to models created in
  functions), #1686 by @MrMrRobat
* Add private attributes support, #1679 by @MrMrRobat
* add `config` to `@validate_arguments`, #1663 by @samuelcolvin
* Allow descendant Settings models to override env variable names for the fields defined in parent Settings models with
  `env` in their `Config`. Previously only `env_prefix` configuration option was applicable, #1561 by @ojomio
* Support `ref_template` when creating schema `$ref`s, #1479 by @kilo59
* Add a `__call__` stub to `PyObject` so that mypy will know that it is callable, #1352 by @brianmaissy
* `pydantic.dataclasses.dataclass` decorator now supports built-in `dataclasses.dataclass`.
  It is hence possible to convert an existing `dataclass` easily to add *pydantic* validation.
  Moreover nested dataclasses are also supported, #744 by @PrettyWood

* **Security fix:** Fix `date` and `datetime` parsing so passing either `'infinity'` or `float('inf')`
  (or their negative values) does not cause an infinite loop,
  See security advisory [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=dfce247efb30baf67ea73195cacc0d83c546cc87

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-dantic/DESCR    | 24 +++---------------------
 py-dantic/Makefile |  9 ++++++++-
 py-dantic/PLIST    |  9 +++++++++
 py-dantic/TODO     |  2 --
 py-dantic/distinfo |  6 +++---
 5 files changed, 23 insertions(+), 27 deletions(-)

diffs:
diff --git a/py-dantic/DESCR b/py-dantic/DESCR
index df65d88365..abde3495c0 100644
--- a/py-dantic/DESCR
+++ b/py-dantic/DESCR
@@ -1,23 +1,5 @@
-TODO: Adjust the following lines from README.md
-
-# pydantic
-
-[![CI](https://github.com/samuelcolvin/pydantic/workflows/CI/badge.svg?event=push)](https://github.com/samuelcolvin/pydantic/actions?query=event%3Apush+branch%3Amaster+workflow%3ACI)
-[![Coverage](https://codecov.io/gh/samuelcolvin/pydantic/branch/master/graph/badge.svg)](https://codecov.io/gh/samuelcolvin/pydantic)
-[![pypi](https://img.shields.io/pypi/v/pydantic.svg)](https://pypi.python.org/pypi/pydantic)
-[![CondaForge](https://img.shields.io/conda/v/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic)
-[![downloads](https://img.shields.io/pypi/dm/pydantic.svg)](https://pypistats.org/packages/pydantic)
-[![versions](https://img.shields.io/pypi/pyversions/pydantic.svg)](https://github.com/samuelcolvin/pydantic)
-[![license](https://img.shields.io/github/license/samuelcolvin/pydantic.svg)](https://github.com/samuelcolvin/pydantic/blob/master/LICENSE)
-
 Data validation and settings management using Python type hinting.
 
-Fast and extensible, *pydantic* plays nicely with your linters/IDE/brain.
-Define how data should be in pure, canonical Python 3.6+; validate it with *pydantic*.
-
-## Help
-
-See [documentation](https://pydantic-docs.helpmanual.io/) for more details.
-
-## Installation
-...
+Fast and extensible, pydantic plays nicely with your linters/IDE/brain.
+Define how data should be in pure, canonical Python 3.6+; validate
+it with pydantic.
diff --git a/py-dantic/Makefile b/py-dantic/Makefile
index b735a9ddf4..c3fbe2cd33 100644
--- a/py-dantic/Makefile
+++ b/py-dantic/Makefile
@@ -1,6 +1,6 @@
 # $NetBSD$
 
-DISTNAME=	pydantic-1.6.1
+DISTNAME=	pydantic-1.8.2
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME:S/py//}
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_PYPI:=p/pydantic/}
@@ -10,8 +10,15 @@ HOMEPAGE=	https://github.com/samuelcolvin/pydantic
 COMMENT=	Data validation and settings management
 LICENSE=	mit
 
+TEST_DEPENDS+=	${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
+TEST_DEPENDS+=	${PYPKGPREFIX}-test-mock-[0-9]*:../../devel/py-test-mock
+TEST_DEPENDS+=	${PYPKGPREFIX}-typing-extensions-[0-9]*:../../devel/py-typing-extensions
+
 PYTHON_VERSIONS_INCOMPATIBLE=	27
 
+do-test:
+	cd ${WRKSRC} && ${SETENV} ${TEST_ENV} pytest-${PYVERSSUFFIX}
+
 .include "../../devel/py-cython/buildlink3.mk"
 .include "../../lang/python/egg.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/py-dantic/PLIST b/py-dantic/PLIST
index fa1d270de5..653e6c861a 100644
--- a/py-dantic/PLIST
+++ b/py-dantic/PLIST
@@ -2,6 +2,7 @@
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
 ${PYSITELIB}/${EGG_INFODIR}/not-zip-safe
 ${PYSITELIB}/${EGG_INFODIR}/requires.txt
 ${PYSITELIB}/${EGG_INFODIR}/top_level.txt
@@ -9,6 +10,14 @@ ${PYSITELIB}/pydantic/__init__.py
 ${PYSITELIB}/pydantic/__init__.pyc
 ${PYSITELIB}/pydantic/__init__.pyo
 ${PYSITELIB}/pydantic/__init__.so
+${PYSITELIB}/pydantic/_hypothesis_plugin.py
+${PYSITELIB}/pydantic/_hypothesis_plugin.pyc
+${PYSITELIB}/pydantic/_hypothesis_plugin.pyo
+${PYSITELIB}/pydantic/_hypothesis_plugin.so
+${PYSITELIB}/pydantic/annotated_types.py
+${PYSITELIB}/pydantic/annotated_types.pyc
+${PYSITELIB}/pydantic/annotated_types.pyo
+${PYSITELIB}/pydantic/annotated_types.so
 ${PYSITELIB}/pydantic/class_validators.py
 ${PYSITELIB}/pydantic/class_validators.pyc
 ${PYSITELIB}/pydantic/class_validators.pyo
diff --git a/py-dantic/TODO b/py-dantic/TODO
deleted file mode 100644
index 1a935d7534..0000000000
--- a/py-dantic/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-This package has known vulnerabilities, please investigate and fix if possible:
-  CVE-2021-29510
diff --git a/py-dantic/distinfo b/py-dantic/distinfo
index e69c29b223..a2488794e0 100644
--- a/py-dantic/distinfo
+++ b/py-dantic/distinfo
@@ -1,5 +1,5 @@
 $NetBSD$
 
-RMD160 (pydantic-1.6.1.tar.gz) = f78693264940d6b2941eaa766eb2a72bb3ee3c0f
-SHA512 (pydantic-1.6.1.tar.gz) = 779a1b6a0dd73e4e5a53d247603ffcbf7913b66d2fa9c5c3844cf28915908b8477dc05702f4e5ea8bdb2891fbc92861cd4479e5d87ca0651934327ec51926262
-Size (pydantic-1.6.1.tar.gz) = 123473 bytes
+BLAKE2s (pydantic-1.8.2.tar.gz) = 12cd644b08ef6ba9069b07917d2d88abd0fb48383972879e043c8f159707af84
+SHA512 (pydantic-1.8.2.tar.gz) = 9ee60bcfcc37a7b4db9432e319f2c0fd9875bbea603af88e1bf1ce2627220468dd190efe74bd38f37c2394f854687485f8dd2602f1e1535a25adb2e7dbbeb44a
+Size (pydantic-1.8.2.tar.gz) = 263751 bytes


Home | Main Index | Thread Index | Old Index