public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-box/
Date: Sun, 27 Aug 2023 16:12:20 +0000 (UTC)	[thread overview]
Message-ID: <1693152737.242553a42af2e68eea912319c42fb8b4e073ed81.mgorny@gentoo> (raw)

commit:     242553a42af2e68eea912319c42fb8b4e073ed81
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 27 16:04:33 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> 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 <mgorny <AT> 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 @@
 		<remote-id type="github">cdgriffith/Box</remote-id>
 		<remote-id type="pypi">python-box</remote-id>
 	</upstream>
+	<use>
+		<flag name="native-extensions">Compiles native C extensions</flag>
+	</use>
 </pkgmetadata>

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


             reply	other threads:[~2023-08-27 16:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 16:12 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-29 16:58 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-box/ Michał Górny
2024-06-13  4:08 Michał Górny
2024-06-13  4:05 Michał Górny
2023-09-30  6:49 Michał Górny
2023-09-30  6:15 Joonas Niilola
2023-08-27 15:59 Michał Górny
2023-08-27 15:59 Michał Górny
2023-08-06 10:03 Michał Górny
2023-05-05 13:43 Michał Górny
2023-05-04 16:30 Michał Górny
2023-03-28  4:26 Michał Górny
2023-03-27 19:31 Sam James
2023-02-22  5:09 Michał Górny
2023-01-15  7:51 Joonas Niilola
2022-11-14  5:05 Michał Górny
2022-10-30 16:30 Michał Górny
2022-10-12 20:53 Sam James
2022-10-12 20:44 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1693152737.242553a42af2e68eea912319c42fb8b4e073ed81.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox