commit: 1bcb19d1468c1e61f4e026bf3be02b687ffb4c50 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sun Jun 1 15:51:37 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sun Jun 1 15:51:37 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bcb19d1
dev-python/protobuf: Bump to 6.31.1 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> dev-python/protobuf/Manifest | 2 + dev-python/protobuf/protobuf-6.31.1.ebuild | 145 +++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) diff --git a/dev-python/protobuf/Manifest b/dev-python/protobuf/Manifest index 67bc667adcc3..1358c221b7d6 100644 --- a/dev-python/protobuf/Manifest +++ b/dev-python/protobuf/Manifest @@ -2,3 +2,5 @@ DIST protobuf-5.29.4.py.tar.gz 424902 BLAKE2B 54941b008ff5ebd007076448828564128d 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 +DIST protobuf-6.31.1.gh.tar.gz 9602805 BLAKE2B 349a528acaad6bae8c39be2888fcfe855dc71605d2b52e20c24e63b3171a855b0f16c60e4fa8a69bcad8b484edd46232132e7b0256634f420aea2dd207da129e SHA512 9138ac1b1c248246ed9840ab3879a6e18da60c709454ede2cb8e45e66e949998ab6e2c8aba557f0bb0b650ec430caeb546695b23387321ced5bc288866e04ad7 +DIST protobuf-6.31.1.py.tar.gz 441797 BLAKE2B 867ee81473a733020098f76c2ccf22161a73b3a1219e08f0f339f202cff871447d874cc6c13d42ef314a0134d65c56631ba4ab6feb806749f3d18443f666f5d9 SHA512 595c125a116020344d5706adf444e1a3259eae5bce3ca61b92c1ab4cb63c167f97210c71e5e24b8c49c6489777ca6de95abdd398125ba3925313ad5ebe09cc18 diff --git a/dev-python/protobuf/protobuf-6.31.1.ebuild b/dev-python/protobuf/protobuf-6.31.1.ebuild new file mode 100644 index 000000000000..b03f14ae5af9 --- /dev/null +++ b/dev-python/protobuf/protobuf-6.31.1.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 +}
