summaryrefslogtreecommitdiff
path: root/dev-python/betterproto
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-09-28 01:25:58 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-09-28 01:25:58 +0100
commit6405cba4bf18141460bc9fcb8f5580532d4b46f8 (patch)
tree377baa366741990f54b18ea82f5566c48295f4e0 /dev-python/betterproto
parentabc3bfc07d931f667a0f50cf607f1c8a49af879f (diff)
gentoo auto-resync : 28:09:2024 - 01:25:57
Diffstat (limited to 'dev-python/betterproto')
-rw-r--r--dev-python/betterproto/Manifest9
-rw-r--r--dev-python/betterproto/betterproto-2.0.0_beta6.ebuild78
-rw-r--r--dev-python/betterproto/betterproto-2.0.0_beta7.ebuild72
-rw-r--r--dev-python/betterproto/files/betterproto-2.0.0_beta6-pytest-8.patch39
-rw-r--r--dev-python/betterproto/files/betterproto-2.0.0_beta7-pytest-8.patch50
-rw-r--r--dev-python/betterproto/metadata.xml12
6 files changed, 260 insertions, 0 deletions
diff --git a/dev-python/betterproto/Manifest b/dev-python/betterproto/Manifest
new file mode 100644
index 000000000000..287979c8aa59
--- /dev/null
+++ b/dev-python/betterproto/Manifest
@@ -0,0 +1,9 @@
+AUX betterproto-2.0.0_beta6-pytest-8.patch 1270 BLAKE2B 6459dd686d118d1c66b64dea88fc22bb58cbc376eeff9dc559249c972cfa516585139611216b92080e99139b9897f235235a935e2294f12b529b5fdea5d787b1 SHA512 8c8fda38ab2ac0b730f1e991243e73fc339c67f84aa6d374b9d5ba507a4e66f44a20d96c002490336684b7eba14a14e833867b59a17b65130e77c66df6d2c084
+AUX betterproto-2.0.0_beta7-pytest-8.patch 1698 BLAKE2B 9254d4d505d2d670d2fff1096fc57a1770cfa2f84e1e8978f36b81ec1392eaf4ae87d1864e3aab8e5ae24a6c44fc306bb3f8e3e9aec96c0324ea9ee94a84d40c SHA512 719907a38402fe35e26a0f825ab6f097164e43f7b0363dc7a57811dadf23626d0b66820118b3aa68683d5e7d68dd81e92911bdcfd7c28603ad32406a85bcb309
+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
+EBUILD betterproto-2.0.0_beta6.ebuild 1894 BLAKE2B 705d96508c4efe6598c439c3696da12f3d8b9bda089d85e164f344e035ce22d6691d06ef1087408c76232acb4a8e7ab18f04ef15a3f23c13c322535a930d1891 SHA512 0c298d0b9db87d00dbdc58a40239ac33f5af25b4b5b80e32224381097327496448cf71e8165a00945c46490f544c57f1d7eedeed3e2ab953156a5f6c11c9c03a
+EBUILD betterproto-2.0.0_beta7.ebuild 1729 BLAKE2B 00aeab4dd25e308bfdd0e635dd3b85c154b1dff61fe79951211ebe0e777bcdf63d7940798e6c579217f29cb6eef4a61d0270ae617c381d2425057b60b1d23c54 SHA512 2d6495a8832f18bfbf2cd18d6a735f129ec449b635bc1030c2c4ee50b606bf2ed6dcecb38adf8c2339fccc868306ba9d557351ecedce9aeeecca0717237139ba
+MISC metadata.xml 389 BLAKE2B d8de77106339bf6c5c7d3441249208ca1bcc9b4ce612f1b5b8b367f371b7a8e2c9f803d153e11f1de6c3162bd7ac13d855d345befb7601a9b73ea258f37f84b8 SHA512 b36e88c2a53d3f48e601fb571cb1a638a8571eca1cca1afc8087d50d9fd60b5e3706fbdc6d053ab0c40630d9611f0b7ed0ad979f1ff51a048e1a6470b5f3f08c
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/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_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
+
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>