* [gentoo-commits] repo/gentoo:master commit in: dev-python/betterproto/files/, dev-python/betterproto/
@ 2024-09-27 17:31 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-09-27 17:31 UTC (permalink / raw
To: gentoo-commits
commit: e9d13730dde1f436f8b72f7beb732b11f08f924d
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 27 17:07:23 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> 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 <mgorny <AT> 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?= <mgorny@gentoo.org>
+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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+ <stabilize-allarches/>
+ <upstream>
+ <remote-id type="github">danielgtaylor/python-betterproto</remote-id>
+ <remote-id type="pypi">betterproto</remote-id>
+ </upstream>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/betterproto/files/, dev-python/betterproto/
@ 2024-09-27 18:35 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-09-27 18:35 UTC (permalink / raw
To: gentoo-commits
commit: d154792bd5d7955e935cf2bb271b173b8eb2f97e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 27 18:25:04 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 27 18:35:26 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d154792b
dev-python/betterproto: Bump to 2.0.0_beta6
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/betterproto/Manifest | 2 +
.../betterproto/betterproto-2.0.0_beta6.ebuild | 78 ++++++++++++++++++++++
.../files/betterproto-2.0.0_beta6-pytest-8.patch | 39 +++++++++++
3 files changed, 119 insertions(+)
diff --git a/dev-python/betterproto/Manifest b/dev-python/betterproto/Manifest
index 1710e4368371..997b8a961c2d 100644
--- a/dev-python/betterproto/Manifest
+++ b/dev-python/betterproto/Manifest
@@ -1,2 +1,4 @@
+DIST python-betterproto-v.2.0.0b6.gh.tar.gz 158969 BLAKE2B ddf269dbef6d0ed4098ec1e84a48ac64431710c26357da86a4f9f1656ce4f4ed8c29097f7e5c50f73ef0d57e3a7eb35ab18aac1864773cd2878e8970f75537a4 SHA512 2622e7d3bac4c6f04fe32d4abeeadf8af0cfcf08a365b3bb6c855763d4ac0528f90eefebfe70866b6431119fc7860bf61d99692411c82e94de9539b4da56543c
+DIST python-betterproto-v.2.0.0b6.tests.tar.xz 34652 BLAKE2B 51a419a7de999a954b1392a4ca2800b46f92284ec7e16891fdbf268a9debe33bcbdfb9d3135f162c4549ab5aeebfeb82f136e6e90f596e6eed3cebea44bd4a21 SHA512 4b5aad58fadde59bbf33d792ece212cee89764964cf5060883dc36c6662b1dd5524c6e36479f4f49899b4b77340e032f53649fbbe8210573736bd9e7bb9664c3
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_beta6.ebuild b/dev-python/betterproto/betterproto-2.0.0_beta6.ebuild
new file mode 100644
index 000000000000..ec4764c75881
--- /dev/null
+++ b/dev-python/betterproto/betterproto-2.0.0_beta6.ebuild
@@ -0,0 +1,78 @@
+# 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_IGNORE=(
+ # broken with current pydantic
+ tests/inputs/oneof/test_oneof.py
+ )
+ local EPYTEST_DESELECT=(
+ # TODO: ordering issue?
+ "tests/test_inputs.py::test_binary_compatibility[map]"
+ # pydantic
+ tests/inputs/bool/test_bool.py::test_pydantic_no_value
+ )
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest -p asyncio -p pytest_mock
+}
diff --git a/dev-python/betterproto/files/betterproto-2.0.0_beta6-pytest-8.patch b/dev-python/betterproto/files/betterproto-2.0.0_beta6-pytest-8.patch
new file mode 100644
index 000000000000..683daf994f3c
--- /dev/null
+++ b/dev-python/betterproto/files/betterproto-2.0.0_beta6-pytest-8.patch
@@ -0,0 +1,39 @@
+From bfe6592b4f95886bbe395af2c2fa3d9e2a562315 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+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 | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py
+index 84e08bd..bee14f1 100644
+--- a/tests/test_deprecated.py
++++ b/tests/test_deprecated.py
+@@ -32,14 +32,12 @@ 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
+--
+2.46.2
+
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-27 18:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 17:31 [gentoo-commits] repo/gentoo:master commit in: dev-python/betterproto/files/, dev-python/betterproto/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-09-27 18:35 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox