Use tomcli for all TOML patching

[skip changelog]
This commit is contained in:
Benjamin A. Beasley 2024-03-17 11:20:27 -04:00
commit e5df41c8b2
2 changed files with 8 additions and 34 deletions

View file

@ -1,28 +0,0 @@
From d9bd99591c52a8114d38e2a799a2f6101410eb4b Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Fri, 2 Feb 2024 12:51:24 -0500
Subject: [PATCH] Downstream-only: do not strip the compiled Python extension
module
We need useful debuginfo. Upstream set this intentionally, so this makes
sense to keep downstream-only.
---
cramjam-python/pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cramjam-python/pyproject.toml b/cramjam-python/pyproject.toml
index 2a4aa85..16ed5b8 100644
--- a/cramjam-python/pyproject.toml
+++ b/cramjam-python/pyproject.toml
@@ -14,7 +14,7 @@ requires = ["maturin>=0.14"]
build-backend = "maturin"
[tool.maturin]
-strip = true
+strip = false
[project.optional-dependencies]
dev = [
--
2.43.0

View file

@ -15,11 +15,8 @@ URL: https://github.com/milesgranger/cramjam
# the GitHub source archive.
Source: %{url}/archive/v%{version}/cramjam-%{version}.tar.gz
# Do not strip the compiled Python module; we need useful debuginfo. Upstream
# set this intentionally, so this makes sense to keep downstream-only.
Patch: 0001-Downstream-only-do-not-strip-the-compiled-Python-ext.patch
BuildRequires: python3-devel
BuildRequires: tomcli
BuildRequires: cargo-rpm-macros >= 24
%global common_description %{expand:
@ -51,12 +48,17 @@ License: %{shrink:
%prep
%autosetup -n cramjam-%{version} -p1
%autosetup -n cramjam-%{version}
# Do not strip the compiled Python module; we need useful debuginfo. Upstream
# set this intentionally, so this makes sense to keep downstream-only.
tomcli set cramjam-python/pyproject.toml false 'tool.maturin.strip'
# Downstream-only: patch out linters/formatters/etc. from the “dev” extra so we
# can use it to generate test dependencies.
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -r -i 's/^([[:blank:]]*)("(black)\b)/\1# \2/' cramjam-python/pyproject.toml
tomcli set cramjam-python/pyproject.toml lists delitem --type regex \
'project.optional-dependencies.dev' '(black)\b.*'
# Remove bundled rust-libcramjam and the sources for cramjam-cli, which is
# versioned and released separately. Keep only the contents of cramjam-python/