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 7022D158041 for ; Fri, 8 Mar 2024 18:28:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8BF18E29D7; Fri, 8 Mar 2024 18:28:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6FA29E29D7 for ; Fri, 8 Mar 2024 18:28:50 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9BD7833BEBE for ; Fri, 8 Mar 2024 18:28:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1D80514F0 for ; Fri, 8 Mar 2024 18:28:48 +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: <1709922522.293ae46213fe0e457c9ff2ff844c39be63296886.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/maturin/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/maturin/maturin-1.5.0.ebuild X-VCS-Directories: dev-util/maturin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 293ae46213fe0e457c9ff2ff844c39be63296886 X-VCS-Branch: master Date: Fri, 8 Mar 2024 18:28:48 +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: b4bf4d62-3e15-4b2f-b2b7-d7c69a2c21a0 X-Archives-Hash: 7d567de458744cce0b63657c191bcdca commit: 293ae46213fe0e457c9ff2ff844c39be63296886 Author: Michał Górny gentoo org> AuthorDate: Fri Mar 8 16:21:43 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Mar 8 18:28:42 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=293ae462 dev-util/maturin: Build maturin executable via cargo.eclass Split the build into building the `maturin` executable via cargo.eclass, and the Python modules via `setuptools`, in order to avoid unnecessarily rebuilding it multiple times. In order to achieve this, we strip `rust_extensions=` from `setup.py` — we can also remove the dependency on `dev-python/setuptools-rust` while at it. Signed-off-by: Michał Górny gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/35671 Signed-off-by: Michał Górny gentoo.org> dev-util/maturin/maturin-1.5.0.ebuild | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dev-util/maturin/maturin-1.5.0.ebuild b/dev-util/maturin/maturin-1.5.0.ebuild index 869513291b7e..d18df31e0dcc 100644 --- a/dev-util/maturin/maturin-1.5.0.ebuild +++ b/dev-util/maturin/maturin-1.5.0.ebuild @@ -418,10 +418,10 @@ CRATES_TEST=" windows_x86_64_msvc@0.36.1 windows_x86_64_msvc@0.48.0 " -DISTUTILS_EXT=1 #926507 + DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( pypy3 python3_{10..12} ) -inherit cargo distutils-r1 edo shell-completion toolchain-funcs +inherit cargo distutils-r1 shell-completion toolchain-funcs DESCRIPTION="Build and publish crates with pyo3, rust-cpython and cffi bindings" HOMEPAGE="https://www.maturin.rs/" @@ -446,7 +446,6 @@ RESTRICT="!test? ( test )" RDEPEND="$(python_gen_cond_dep 'dev-python/tomli[${PYTHON_USEDEP}]' 3.10)" DEPEND="ssl? ( dev-libs/openssl:= )" BDEPEND=" - dev-python/setuptools-rust[${PYTHON_USEDEP}] virtual/pkgconfig doc? ( app-text/mdbook ) test? ( @@ -464,6 +463,9 @@ QA_FLAGS_IGNORED="usr/bin/${PN}" src_prepare() { distutils-r1_src_prepare + # we build the Rust executable (just once) via cargo_src_compile + sed -i -e '/setuptools_rust/d' -e '/rust_extensions/d' setup.py || die + if use test; then # used to prevent use of network during tests, and silence pip # if it finds unrelated issues with system packages (bug #913613) @@ -486,18 +488,19 @@ src_prepare() { } src_configure() { - local cargoargs=( - $(usev debug '--profile dev') - --no-default-features + export OPENSSL_NO_VENDOR=1 + + local myfeatures=( # like release.yml + native-tls for better platform support than rustls - --features full,password-storage$(usev ssl ,native-tls) + full + password-storage + $(usev ssl native-tls) ) - - export MATURIN_SETUP_ARGS=${cargoargs[*]} - export OPENSSL_NO_VENDOR=1 + cargo_src_configure "${cargoargs[@]}" } python_compile_all() { + cargo_src_compile use !doc || mdbook build -d html guide || die if ! tc-is-cross-compiler; then @@ -523,10 +526,12 @@ python_test() { --skip pyo3_no_extension_module ) - edo cargo test $(usev !debug --release) ${MATURIN_SETUP_ARGS} -- "${skip[@]}" + cargo_src_test -- "${skip[@]}" } python_install_all() { + cargo_src_install + dodoc Changelog.md README.md use doc && dodoc -r guide/html