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 E3963158004 for ; Sun, 27 Aug 2023 16:12:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 28B752BC10B; Sun, 27 Aug 2023 16:12:23 +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 09AE12BC10B for ; Sun, 27 Aug 2023 16:12:23 +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 120C0335DB4 for ; Sun, 27 Aug 2023 16:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 70AF6E8E for ; Sun, 27 Aug 2023 16:12:20 +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: <1693152737.242553a42af2e68eea912319c42fb8b4e073ed81.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-box/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/python-box/metadata.xml dev-python/python-box/python-box-7.1.1.ebuild X-VCS-Directories: dev-python/python-box/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 242553a42af2e68eea912319c42fb8b4e073ed81 X-VCS-Branch: master Date: Sun, 27 Aug 2023 16:12:20 +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: 926d8327-73f2-40f4-b0ce-41ecf78b718a X-Archives-Hash: 2a34f56960e828a66f151eb622ed0006 commit: 242553a42af2e68eea912319c42fb8b4e073ed81 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 27 16:04:33 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Aug 27 16:12:17 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=242553a4 dev-python/python-box: Make C extensions optional Signed-off-by: Michał Górny gentoo.org> dev-python/python-box/metadata.xml | 3 +++ dev-python/python-box/python-box-7.1.1.ebuild | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dev-python/python-box/metadata.xml b/dev-python/python-box/metadata.xml index c0dbbdd823f3..a825fd0ab27e 100644 --- a/dev-python/python-box/metadata.xml +++ b/dev-python/python-box/metadata.xml @@ -13,4 +13,7 @@ cdgriffith/Box python-box + + Compiles native C extensions + diff --git a/dev-python/python-box/python-box-7.1.1.ebuild b/dev-python/python-box/python-box-7.1.1.ebuild index 56e494cdc8a1..a71c7fcf6444 100644 --- a/dev-python/python-box/python-box-7.1.1.ebuild +++ b/dev-python/python-box/python-box-7.1.1.ebuild @@ -24,6 +24,7 @@ S=${WORKDIR}/${MY_P} LICENSE="MIT" SLOT="0" KEYWORDS="~amd64" +IUSE="+native-extensions" RDEPEND=" dev-python/msgpack[${PYTHON_USEDEP}] @@ -34,11 +35,23 @@ RDEPEND=" dev-python/tomli-w[${PYTHON_USEDEP}] " BDEPEND=" - dev-python/cython[${PYTHON_USEDEP}] + native-extensions? ( + dev-python/cython[${PYTHON_USEDEP}] + ) " distutils_enable_tests pytest +src_prepare() { + if ! use native-extensions; then + # a cheap hack, extensions are auto-disabled if Cython.Build + # is not importable + > Cython.py || die + fi + + distutils-r1_src_prepare +} + python_test() { rm -rf box || die epytest