From nobody Wed Sep 06 20:53:17 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RgvjB0J5Vz4sw5x; Wed, 6 Sep 2023 20:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rgvj92dHVz3FFf; Wed, 6 Sep 2023 20:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694033597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sebn7f37hk+0Tjo75bXuDi8Xl9NR7SK8AvyCCBJzLFI=; b=NNmYvoDrxjMgjo9pvdWJq722SCXUSTxE3dPrubXTCA+YofQ1c2NJ+Jsz32YUnGXP7T2cJu 6Q7tImCdMnRg05wi5w+72OQvhZS/VO2U+uxIF7BiLNpCzdnRwGKqV3u31hDg6hVYnXnv7p 2Pt7UX9pM40xiTdjfLid5lwFsjNNd0iXajL5LmUDcq1Ob5oLjjbDb569IFGjHDN//caZDO HpLOHVyb/CinnK3eF2EXaoDrOe7iLIiCVU6tjRBjEN3YvNiPPUnEt9acDTUFYxPFY1KBVW B39vGLO7rqaWKcnU+ep5sZSnBTK3gRU7N9Tp+/zimT3fTZW+LO6zVN/LlWpDig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694033597; a=rsa-sha256; cv=none; b=D11qvfjLd2vYTB23ZB7sHrb5TgNjxaew58lizgnhH/L/0y7oy+Lzrcv3/oKhVxQ2hV/oyD x7/p54MKRhZFtmDqorFvUvPX1avHnkEHhAiC+qzmg7kccZIR5bqdVWyYHKOQR4jpuWQYBO i4dMNEb/cJ76y8XIvnyFxEGoWhji2kyQYKjNEn7KTlbQe6Ry/UupSThILgoVmHYeem+nHy XePOm4EZG1fk66sGjT/whsA+zlCoZMFlgXRxjO7EUrfmRhuMoijRGCTWqL+l+2s7m8CB23 y9vUZNkuanqjjnJru2vFaOBbc9FEe9ixn5ZZvuZbHi5eGQmdvHqz19YeZsYJYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694033597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sebn7f37hk+0Tjo75bXuDi8Xl9NR7SK8AvyCCBJzLFI=; b=NjEXV+AyVuKSl4rLV+goxa/4WWF5B0Zxi0zy3aPa7Kj9iceti/VME6VEgyI9fT+tLkjtZ6 zLksKG6yipUeGswHill6NUAh1P2CbEXuSvKsHLXfg9VyaRIJhQV4fkH9N//anOwnDNeKRw W/PnlZQ48oREFX1AkgEpdfUlVi26pYAPrplnOU1GQ1taUxvwkj2bl1WgSvtNoydGwa1lBE WPCWP7pobrA3wURYgC6NA4UF3DonHDGnOLJuZ25/+uPIzH0TBdnKBir3FR/UlL92mDZKEs TJXDSSVEwbMbHhBelocYpAcHYJ9KELTQ22kjTdvNYF9FlzUA8wCPCTuiev9RJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rgvj91lSgzXgJ; Wed, 6 Sep 2023 20:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 386KrHpE019987; Wed, 6 Sep 2023 20:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 386KrHLb019984; Wed, 6 Sep 2023 20:53:17 GMT (envelope-from git) Date: Wed, 6 Sep 2023 20:53:17 GMT Message-Id: <202309062053.386KrHLb019984@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: cbbc841775b4 - main - devel/py-pydantic2: Allow build with py-pydantic-core 2.7.0 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbbc841775b458ea8c654810d56de5fe2d96cd29 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=cbbc841775b458ea8c654810d56de5fe2d96cd29 commit cbbc841775b458ea8c654810d56de5fe2d96cd29 Author: Po-Chuan Hsieh AuthorDate: 2023-09-06 20:49:44 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-09-06 20:49:44 +0000 devel/py-pydantic2: Allow build with py-pydantic-core 2.7.0 - Bump PORTREVISION for package change Obtained from: https://github.com/pydantic/pydantic/commit/2575e71894a32dc615f9fa7a94ff37bb604a48a8 --- devel/py-pydantic2/Makefile | 3 +- devel/py-pydantic2/files/patch-pydantic-core | 171 +++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 1 deletion(-) diff --git a/devel/py-pydantic2/Makefile b/devel/py-pydantic2/Makefile index 09227642fc44..8bf5552b697f 100644 --- a/devel/py-pydantic2/Makefile +++ b/devel/py-pydantic2/Makefile @@ -1,5 +1,6 @@ PORTNAME= pydantic PORTVERSION= 2.3.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -16,7 +17,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatch-fancy-pypi-readme>=22.5.0:devel/py-hatch-fancy-pypi-readme@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}hatchling>=0:devel/py-hatchling@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}annotated-types>=0.4.0:devel/py-annotated-types@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pydantic-core>=2.6.3<2.6.3_99:devel/py-pydantic-core@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pydantic-core>=2.7.0<2.7.0_99:devel/py-pydantic-core@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.6.1:devel/py-typing-extensions@${PY_FLAVOR} USES= python diff --git a/devel/py-pydantic2/files/patch-pydantic-core b/devel/py-pydantic2/files/patch-pydantic-core new file mode 100644 index 000000000000..79f89fd3a010 --- /dev/null +++ b/devel/py-pydantic2/files/patch-pydantic-core @@ -0,0 +1,171 @@ +Obtained from: https://github.com/pydantic/pydantic/commit/2575e71894a32dc615f9fa7a94ff37bb604a48a8 + +--- pydantic/_internal/_core_utils.py.orig 2020-02-02 00:00:00 UTC ++++ pydantic/_internal/_core_utils.py +@@ -262,9 +262,9 @@ class _WalkCoreSchema: + ) -> core_schema.CoreSchema: + schema = cast(core_schema.TuplePositionalSchema, schema) + schema['items_schema'] = [self.walk(v, f) for v in schema['items_schema']] +- extra_schema = schema.get('extra_schema') +- if extra_schema is not None: +- schema['extra_schema'] = self.walk(extra_schema, f) ++ extras_schema = schema.get('extras_schema') ++ if extras_schema is not None: ++ schema['extras_schema'] = self.walk(extras_schema, f) + return schema + + def handle_dict_schema(self, schema: core_schema.DictSchema, f: Walk) -> core_schema.CoreSchema: +@@ -314,9 +314,9 @@ class _WalkCoreSchema: + return schema + + def handle_model_fields_schema(self, schema: core_schema.ModelFieldsSchema, f: Walk) -> core_schema.CoreSchema: +- extra_validator = schema.get('extra_validator') +- if extra_validator is not None: +- schema['extra_validator'] = self.walk(extra_validator, f) ++ extras_schema = schema.get('extras_schema') ++ if extras_schema is not None: ++ schema['extras_schema'] = self.walk(extras_schema, f) + replaced_fields: dict[str, core_schema.ModelField] = {} + replaced_computed_fields: list[core_schema.ComputedField] = [] + for computed_field in schema.get('computed_fields', ()): +@@ -333,9 +333,9 @@ class _WalkCoreSchema: + return schema + + def handle_typed_dict_schema(self, schema: core_schema.TypedDictSchema, f: Walk) -> core_schema.CoreSchema: +- extra_validator = schema.get('extra_validator') +- if extra_validator is not None: +- schema['extra_validator'] = self.walk(extra_validator, f) ++ extras_schema = schema.get('extras_schema') ++ if extras_schema is not None: ++ schema['extras_schema'] = self.walk(extras_schema, f) + replaced_computed_fields: list[core_schema.ComputedField] = [] + for computed_field in schema.get('computed_fields', ()): + replaced_field = computed_field.copy() +--- pydantic/_internal/_generate_schema.py.orig 2020-02-02 00:00:00 UTC ++++ pydantic/_internal/_generate_schema.py +@@ -480,7 +480,7 @@ class GenerateSchema: + + model_validators = decorators.model_validators.values() + +- extra_validator = None ++ extras_schema = None + if core_config.get('extra_fields_behavior') == 'allow': + for tp in (cls, *cls.__mro__): + extras_annotation = cls.__annotations__.get('__pydantic_extra__', None) +@@ -495,7 +495,7 @@ class GenerateSchema: + required=True, + )[1] + if extra_items_type is not Any: +- extra_validator = self.generate_schema(extra_items_type) ++ extras_schema = self.generate_schema(extra_items_type) + break + + with self._config_wrapper_stack.push(config_wrapper): +@@ -521,7 +521,7 @@ class GenerateSchema: + self._computed_field_schema(d, decorators.field_serializers) + for d in computed_fields.values() + ], +- extra_validator=extra_validator, ++ extras_schema=extras_schema, + model_name=cls.__name__, + ) + inner_schema = apply_validators(fields_schema, decorators.root_validators.values(), None) +--- pydantic/json_schema.py.orig 2020-02-02 00:00:00 UTC ++++ pydantic/json_schema.py +@@ -795,8 +795,8 @@ class GenerateJsonSchema: + prefixItems = [self.generate_inner(item) for item in schema['items_schema']] + if prefixItems: + json_schema['prefixItems'] = prefixItems +- if 'extra_schema' in schema: +- json_schema['items'] = self.generate_inner(schema['extra_schema']) ++ if 'extras_schema' in schema: ++ json_schema['items'] = self.generate_inner(schema['extras_schema']) + else: + json_schema['maxItems'] = len(schema['items_schema']) + self.update_with_validations(json_schema, schema, self.ValidationsMapping.array) +@@ -1383,10 +1383,10 @@ class GenerateJsonSchema: + if self.mode == 'serialization': + named_required_fields.extend(self._name_required_computed_fields(schema.get('computed_fields', []))) + json_schema = self._named_required_fields_schema(named_required_fields) +- extra_validator = schema.get('extra_validator', None) +- if extra_validator is not None: ++ extras_schema = schema.get('extras_schema', None) ++ if extras_schema is not None: + schema_to_update = self.resolve_schema_to_update(json_schema) +- schema_to_update['additionalProperties'] = self.generate_inner(extra_validator) ++ schema_to_update['additionalProperties'] = self.generate_inner(extras_schema) + return json_schema + + def field_is_present(self, field: CoreSchemaField) -> bool: +--- pydantic/v1/main.py.orig 2020-02-02 00:00:00 UTC ++++ pydantic/v1/main.py +@@ -161,9 +161,9 @@ class ModelMetaclass(ABCMeta): + + for f in fields.values(): + f.set_config(config) +- extra_validators = vg.get_validators(f.name) +- if extra_validators: +- f.class_validators.update(extra_validators) ++ extras_schemas = vg.get_validators(f.name) ++ if extras_schemas: ++ f.class_validators.update(extras_schemas) + # re-run prepare to add extra validators + f.populate_validators() + +--- pyproject.toml.orig 2020-02-02 00:00:00 UTC ++++ pyproject.toml +@@ -61,7 +61,7 @@ requires-python = '>=3.7' + dependencies = [ + 'typing-extensions>=4.6.1', + 'annotated-types>=0.4.0', +- "pydantic-core==2.6.3", ++ "pydantic-core==2.7.0", + ] + dynamic = ['version', 'readme'] + +--- tests/test_json_schema.py.orig 2020-02-02 00:00:00 UTC ++++ tests/test_json_schema.py +@@ -2475,7 +2475,7 @@ def test_tuple_with_extra_schema(): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema: + return core_schema.tuple_positional_schema( +- [core_schema.int_schema(), core_schema.str_schema()], extra_schema=core_schema.int_schema() ++ [core_schema.int_schema(), core_schema.str_schema()], extras_schema=core_schema.int_schema() + ) + + class Model(BaseModel): +--- tests/test_utils.py.orig 2020-02-02 00:00:00 UTC ++++ tests/test_utils.py +@@ -547,8 +547,8 @@ def test_camel2snake(value: str, result: str) -> None: + ( + pytest.param({}, {}, id='Positional tuple without extra_schema'), + pytest.param( +- {'extra_schema': core_schema.float_schema()}, +- {'extra_schema': {'type': 'str'}}, ++ {'extras_schema': core_schema.float_schema()}, ++ {'extras_schema': {'type': 'str'}}, + id='Positional tuple with extra_schema', + ), + ), +@@ -575,8 +575,8 @@ def test_handle_tuple_positional_schema(params, expect + ( + pytest.param({}, {}, id='Model fields without extra_validator'), + pytest.param( +- {'extra_validator': core_schema.float_schema()}, +- {'extra_validator': {'type': 'str'}}, ++ {'extras_schema': core_schema.float_schema()}, ++ {'extras_schema': {'type': 'str'}}, + id='Model fields with extra_validator', + ), + ), +@@ -608,8 +608,8 @@ def test_handle_model_fields_schema(params, expected_e + ( + pytest.param({}, {}, id='Typeddict without extra_validator'), + pytest.param( +- {'extra_validator': core_schema.float_schema()}, +- {'extra_validator': {'type': 'str'}}, ++ {'extras_schema': core_schema.float_schema()}, ++ {'extras_schema': {'type': 'str'}}, + id='Typeddict with extra_validator', + ), + ),