From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5508415808B for ; Fri, 27 Sep 2024 17:31:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 83E1EE2A24; Fri, 27 Sep 2024 17:31:51 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 483D7E2A24 for ; Fri, 27 Sep 2024 17:31:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4BC473430DF for ; Fri, 27 Sep 2024 17:31:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A9611C36 for ; Fri, 27 Sep 2024 17:31:48 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1727458238.e9d13730dde1f436f8b72f7beb732b11f08f924d.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/betterproto/files/, dev-python/betterproto/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/betterproto/Manifest dev-python/betterproto/betterproto-2.0.0_beta7.ebuild dev-python/betterproto/files/betterproto-2.0.0_beta7-pytest-8.patch dev-python/betterproto/metadata.xml X-VCS-Directories: dev-python/betterproto/ dev-python/betterproto/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: e9d13730dde1f436f8b72f7beb732b11f08f924d X-VCS-Branch: master Date: Fri, 27 Sep 2024 17:31:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 595c9deb-fdd8-43a9-8b56-0bdf338b7b03 X-Archives-Hash: 12341abf8ac115d878bd5da3002c512c commit: e9d13730dde1f436f8b72f7beb732b11f08f924d Author: Michał Górny gentoo org> AuthorDate: Fri Sep 27 17:07:23 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Sep 27 17:30:38 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9d13730 dev-python/betterproto: New package, 2.0.0_beta7, dep of sigstore Signed-off-by: Michał Górny gentoo.org> dev-python/betterproto/Manifest | 2 + .../betterproto/betterproto-2.0.0_beta7.ebuild | 72 ++++++++++++++++++++++ .../files/betterproto-2.0.0_beta7-pytest-8.patch | 50 +++++++++++++++ dev-python/betterproto/metadata.xml | 12 ++++ 4 files changed, 136 insertions(+) diff --git a/dev-python/betterproto/Manifest b/dev-python/betterproto/Manifest new file mode 100644 index 000000000000..1710e4368371 --- /dev/null +++ b/dev-python/betterproto/Manifest @@ -0,0 +1,2 @@ +DIST python-betterproto-v.2.0.0b7.gh.tar.gz 217820 BLAKE2B 2ede4c7b106c8c01279e1e57bc34c13c4e274215f077ae1d294108f40b6043682276c31703b1443bac5ab072a761141de306ff95cb34653180a9ee5bebe29b86 SHA512 4ca16c1cd09d76cde69848e6691be6f5716f730b7107f72e4a006c9b5881c815f4f24f9941861a972405d6d08bb47425900428886d1f8a2e37ace370c4514fbe +DIST python-betterproto-v.2.0.0b7.tests.tar.xz 36328 BLAKE2B 43bb385c6e6746602b210fdf10a94bb4508366230461823d96fbdbeb868b1e0952cb1a3a596bfa4bbaa2e71b643e17cabeb4e11546c5eedf47d632e07d4078aa SHA512 a8b090d04e89a57dc8ff3b7775756cbf7d07bb317e47f76e12704cd41583b32a4f5f106a72af8c66f63e6def9bfc22ad93b4c39169b06b92b47a9f386326dfa7 diff --git a/dev-python/betterproto/betterproto-2.0.0_beta7.ebuild b/dev-python/betterproto/betterproto-2.0.0_beta7.ebuild new file mode 100644 index 000000000000..8ae0bd22a427 --- /dev/null +++ b/dev-python/betterproto/betterproto-2.0.0_beta7.ebuild @@ -0,0 +1,72 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=poetry +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 + +TAG=v.${PV/_beta/b} +MY_P=python-betterproto-${TAG} +DESCRIPTION="A better Protobuf / gRPC generator & library" +HOMEPAGE=" + https://github.com/danielgtaylor/python-betterproto/ + https://pypi.org/project/betterproto/ +" +# no tests in sdist, as of 2.0.0b7 +SRC_URI=" + https://github.com/danielgtaylor/python-betterproto/archive/${TAG}.tar.gz + -> ${MY_P}.gh.tar.gz +" +if [[ ${PKGBUMPING} != ${PVR} ]]; then + # poetry install -E compiler + # poetry run python -m tests.generate -v + # pack tests/output* + SRC_URI+=" + test? ( + https://dev.gentoo.org/~mgorny/dist/${MY_P}.tests.tar.xz + ) + " +fi +S=${WORKDIR}/${MY_P} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + >=dev-python/black-23.1.0[${PYTHON_USEDEP}] + >=dev-python/grpclib-0.4.1[${PYTHON_USEDEP}] + >=dev-python/isort-5.11.5[${PYTHON_USEDEP}] + >=dev-python/jinja-3.0.3[${PYTHON_USEDEP}] + >=dev-python/python-dateutil-2.8[${PYTHON_USEDEP}] + >=dev-python/typing-extensions-4.7.1[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/cachelib[${PYTHON_USEDEP}] + dev-python/pydantic[${PYTHON_USEDEP}] + dev-python/tomlkit[${PYTHON_USEDEP}] + dev-python/pytest-asyncio[${PYTHON_USEDEP}] + dev-python/pytest-mock[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/danielgtaylor/python-betterproto/pull/622 + "${FILESDIR}/${P}-pytest-8.patch" +) + +python_test() { + local EPYTEST_DESELECT=( + # TODO: ordering issue? + "tests/test_inputs.py::test_binary_compatibility[map]" + ) + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -p asyncio -p pytest_mock +} diff --git a/dev-python/betterproto/files/betterproto-2.0.0_beta7-pytest-8.patch b/dev-python/betterproto/files/betterproto-2.0.0_beta7-pytest-8.patch new file mode 100644 index 000000000000..b311826cf4c9 --- /dev/null +++ b/dev-python/betterproto/files/betterproto-2.0.0_beta7-pytest-8.patch @@ -0,0 +1,50 @@ +From f891957c8f0d355ea7cc20194050f3346fd16006 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 27 Sep 2024 19:01:53 +0200 +Subject: [PATCH] Update no-warning tests for pytest-8 + +Replace the deprecated `pytest.warns(None)` with the suggested +replacement (from https://github.com/pytest-dev/pytest/issues/9404) +to make the test suite forward compatible with pytest-8. This works +correctly with pytest-6 as well. +--- + tests/test_deprecated.py | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py +index c1caead3..ea16d370 100644 +--- a/tests/test_deprecated.py ++++ b/tests/test_deprecated.py +@@ -35,18 +35,16 @@ def test_message_with_deprecated_field(message): + + + def test_message_with_deprecated_field_not_set(message): +- with pytest.warns(None) as record: ++ with warnings.catch_warnings(): ++ warnings.simplefilter("error") + Test(value=10) + +- assert not record +- + + def test_message_with_deprecated_field_not_set_default(message): +- with pytest.warns(None) as record: ++ with warnings.catch_warnings(): ++ warnings.simplefilter("error") + _ = Test(value=10).message + +- assert not record +- + + @pytest.mark.asyncio + async def test_service_with_deprecated_method(): +@@ -58,7 +56,6 @@ async def test_service_with_deprecated_method(): + assert len(record) == 1 + assert str(record[0].message) == f"TestService.deprecated_func is deprecated" + +- with pytest.warns(None) as record: ++ with warnings.catch_warnings(): ++ warnings.simplefilter("error") + await stub.func(Empty()) +- +- assert not record diff --git a/dev-python/betterproto/metadata.xml b/dev-python/betterproto/metadata.xml new file mode 100644 index 000000000000..a610b16cbd3c --- /dev/null +++ b/dev-python/betterproto/metadata.xml @@ -0,0 +1,12 @@ + + + + + python@gentoo.org + + + + danielgtaylor/python-betterproto + betterproto + +