From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 finch.gentoo.org (Postfix) with ESMTPS id A230E1580E0 for ; Sun, 01 Jun 2025 15:41:11 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (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) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 8F66B33FEBF for ; Sun, 01 Jun 2025 15:41:11 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 8531711027C; Sun, 01 Jun 2025 15:41:10 +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 bobolink.gentoo.org (Postfix) with ESMTPS id 78DFE11027C for ; Sun, 01 Jun 2025 15:41:10 +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 25D3A3430AC for ; Sun, 01 Jun 2025 15:41:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 65D6EB6F for ; Sun, 01 Jun 2025 15:41:08 +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: <1748792465.caf505a17e6617f4ba859330354f657b1f97beb6.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/protobuf/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/protobuf/Manifest dev-python/protobuf/protobuf-6.30.2-r2.ebuild X-VCS-Directories: dev-python/protobuf/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: caf505a17e6617f4ba859330354f657b1f97beb6 X-VCS-Branch: master Date: Sun, 01 Jun 2025 15:41:08 +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: 555438f1-ea85-4278-88ac-646e33578d1f X-Archives-Hash: d3423a77c3f6e60972777938868b3cd5 commit: caf505a17e6617f4ba859330354f657b1f97beb6 Author: Michał Górny gentoo org> AuthorDate: Sun Jun 1 15:40:37 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Jun 1 15:41:05 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caf505a1 dev-python/protobuf: Enable testing Signed-off-by: Michał Górny gentoo.org> dev-python/protobuf/Manifest | 1 + dev-python/protobuf/protobuf-6.30.2-r2.ebuild | 145 ++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) diff --git a/dev-python/protobuf/Manifest b/dev-python/protobuf/Manifest index dbb057902755..67bc667adcc3 100644 --- a/dev-python/protobuf/Manifest +++ b/dev-python/protobuf/Manifest @@ -1,3 +1,4 @@ DIST protobuf-5.29.4.py.tar.gz 424902 BLAKE2B 54941b008ff5ebd007076448828564128d98e9a6a4613c87057c359124940d341358fe28107b929e3e842ac7e1b34ed54c30219ed95cbb418826592e2458a01f SHA512 634faf103ed8320762593689796d26e6b988e1b40277b12dc7356983c07d5d1da8cac1530e4f16c0a1494abfb885f26bf9884988029e863515cf535c62d96c77 DIST protobuf-5.29.5.py.tar.gz 425226 BLAKE2B 1d7461e94ba8bc097d6f52170678665e3cd97ef44e4757e6c20bcb1bdfbfe673d26cd4a63f8e6972af964e381dfffedeb9a4959ec7a7d5a3a3f87f917c8aa329 SHA512 cbb39efe7f6499362b3e4cc9f073df921c8b83d3aafde245a2ca3432f3e744a428e946799c48b2797e08312342e164eced0bf2b8865b8d042b54913855abb1c8 +DIST protobuf-6.30.2.gh.tar.gz 9523913 BLAKE2B d3950abfe8b3b61dc2bb61f683b014de29451252c46b670dee75a81eb0b8ed30a3209227aa9483800244af16058469deb281521609d769a3456a798ca8a9a4a3 SHA512 f2ee857a36b49f87257a306b3f3c361770d74aaf24c4650b9d00994e1e1a0b09079fb0ce5ffb4d5a4a32d8ca46e3247d6db454918fa0b104fc8d58e8a0546a96 DIST protobuf-6.30.2.py.tar.gz 429315 BLAKE2B 6b56e23a8a962ce9da282ec49c4807877f4bfb677ad84bb6930b83cc436e9839f5791cfb19105678881c8361e27d62d3dde51e5e6c42f7a0e146d9e469282780 SHA512 48ddb2b63acc91759ba4243926c50bb0d16601aace9019129975701634b77a59415659751c69b06464afe994a0fbbd8da6640a208b743ba7df8bf6d60c5ec2b9 diff --git a/dev-python/protobuf/protobuf-6.30.2-r2.ebuild b/dev-python/protobuf/protobuf-6.30.2-r2.ebuild new file mode 100644 index 000000000000..0d60b5a6f32d --- /dev/null +++ b/dev-python/protobuf/protobuf-6.30.2-r2.ebuild @@ -0,0 +1,145 @@ +# Copyright 2008-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Default implementation currently is upb, which doesn't match dev-libs/protobuf +# https://github.com/protocolbuffers/protobuf/blob/main/python/README.md#implementation-backends + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{11..13} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Google's Protocol Buffers - Python bindings" +HOMEPAGE=" + https://protobuf.dev/ + https://pypi.org/project/protobuf/ +" +# Rename sdist to avoid conflicts with dev-libs/protobuf +SRC_URI=" + $(pypi_sdist_url) -> ${P}.py.tar.gz + test? ( + https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz + ) +" + +LICENSE="BSD" +SLOT="0/$(ver_cut 1-3)" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" + +# need protobuf compiler +BDEPEND=" + test? ( + dev-libs/protobuf + dev-python/absl-py[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_unpack() { + unpack "${P}.py.tar.gz" + + if use test; then + mkdir "${WORKDIR}/test" || die + cd "${WORKDIR}/test" || die + unpack "${P}.gh.tar.gz" + fi +} + +src_prepare() { + distutils-r1_src_prepare + + # strip old-style namespace + rm google/__init__.py || die +} + +python_test() { + local EPYTEST_IGNORE=( + # TODO: figure out how to build the pybind11 test extension + google/protobuf/internal/recursive_message_pybind11_test.py + ) + + case ${EPYTHON} in + python3.11) + EPYTEST_IGNORE+=( + # syntax error... + google/protobuf/internal/json_format_test.py + ) + ;; + python3.13) + # TODO: segfaults on exit + return + ;; + esac + + cp -r "${BUILD_DIR}"/{install,test} || die + local -x PATH="${BUILD_DIR}/test${EPREFIX}/usr/bin:${PATH}" + cd "${BUILD_DIR}/test$(python_get_sitedir)" || die + + # copy test files from the source tree + cp -r "${WORKDIR}/test/${P}/python/google/protobuf/internal/." \ + google/protobuf/internal/ || die + # link the test data for text_format_test.py + # (it traverses directories upwards until to finds src/google...) + ln -s "${WORKDIR}/test/${P}/src" ../src || die + + # compile test-related protobufs + local test_protos=( + # from src + any_test.proto + map_proto2_unittest.proto + map_unittest.proto + unittest.proto + unittest_custom_options.proto + unittest_delimited.proto + unittest_delimited_import.proto + unittest_features.proto + unittest_import.proto + unittest_import_public.proto + unittest_legacy_features.proto + unittest_mset.proto + unittest_mset_wire_format.proto + unittest_no_field_presence.proto + unittest_no_generic_services.proto + unittest_proto3.proto + unittest_proto3_arena.proto + unittest_proto3_extensions.proto + unittest_retention.proto + util/json_format.proto + util/json_format_proto3.proto + # from python + internal/descriptor_pool_test1.proto + internal/descriptor_pool_test2.proto + internal/factory_test1.proto + internal/factory_test2.proto + internal/file_options_test.proto + internal/import_test_package/import_public.proto + internal/import_test_package/import_public_nested.proto + internal/import_test_package/inner.proto + internal/import_test_package/outer.proto + internal/message_set_extensions.proto + internal/missing_enum_values.proto + internal/more_extensions.proto + internal/more_messages.proto + internal/no_package.proto + internal/packed_field_test.proto + internal/self_recursive.proto + internal/test_bad_identifiers.proto + internal/test_proto2.proto + internal/test_proto3_optional.proto + internal/well_known_types_test.proto + ) + local proto + for proto in "${test_protos[@]}"; do + protoc --python_out=. -I"${WORKDIR}/test/${P}/src" -I. \ + "google/protobuf/${proto}" || die + done + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -s +}