public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/snakemake] f44: Patch for PEP 661 sentinels; fixes RHBZ#2483710
Date: Mon, 01 Jun 2026 11:50:24 GMT [thread overview]
Message-ID: <178031462454.1.1719142238580110795.rpms-snakemake-6d34ef7dec9e@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/snakemake
Branch : f44
Commit : 6d34ef7dec9ec94f2075741b70d7f74b2dfccb60
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-06-01T12:06:47+01:00
Stats : +49/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/snakemake/c/6d34ef7dec9ec94f2075741b70d7f74b2dfccb60?branch=f44
Log:
Patch for PEP 661 sentinels; fixes RHBZ#2483710
---
diff --git a/4211.patch b/4211.patch
new file mode 100644
index 0000000..42c54e5
--- /dev/null
+++ b/4211.patch
@@ -0,0 +1,44 @@
+From 6d13f1135a97f357c96fd42f2ae46d8c0366061e Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Mon, 1 Jun 2026 11:33:07 +0100
+Subject: [PATCH] Adapt for dataclasses._MISSING_TYPE replaced with sentinel in
+ Python 3.15
+
+See https://github.com/python/cpython/pull/149086 and PEP 661.
+---
+ src/snakemake/common/argparse.py | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/snakemake/common/argparse.py b/src/snakemake/common/argparse.py
+index 1801419da1..33a765e1c9 100644
+--- a/src/snakemake/common/argparse.py
++++ b/src/snakemake/common/argparse.py
+@@ -66,6 +66,19 @@ class ArgumentDefaultsHelpFormatter(argparse.HelpFormatter):
+ None/dataclasses._MISSING_TYPE/etc.
+ """
+
++ # See https://github.com/python/cpython/pull/149086.
++ if hasattr(dataclasses, "MISSING"):
++ # Python 3.15 and later, with PEP 661
++ @staticmethod
++ def _is_missing(value):
++ return value is dataclasses.MISSING
++
++ else:
++ # Python 3.14 and older, without PEP 661
++ @staticmethod
++ def _is_missing(value):
++ return isinstance(value, dataclasses._MISSING_TYPE)
++
+ def _get_help_string(self, action):
+ if (
+ (
+@@ -73,7 +86,7 @@ def _get_help_string(self, action):
+ or action.nargs in [argparse.OPTIONAL, argparse.ZERO_OR_MORE]
+ )
+ and action.default not in (None, "", set(), argparse.SUPPRESS)
+- and not isinstance(action.default, dataclasses._MISSING_TYPE)
++ and not self._is_missing(action.default)
+ ):
+ if isinstance(action.default, collections.abc.Iterable) and not isinstance(
+ action.default, str
diff --git a/snakemake.spec b/snakemake.spec
index ef14a26..9e684bf 100644
--- a/snakemake.spec
+++ b/snakemake.spec
@@ -162,6 +162,11 @@ Source2: get_assets
# the substring "modified-assets" in the patch name.
Patch: snakemake-9.1.1-modified-assets.patch
+# fix: Adapt for dataclasses._MISSING_TYPE replaced with sentinel in Python 3.15
+# https://github.com/snakemake/snakemake/pull/4211
+# Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2483710.
+Patch: %{forgeurl}/pull/4211.patch
+
BuildSystem: pyproject
# Generate BR’s for all supported extras to ensure they do not FTI
BuildOption(generate_buildrequires): --extras reports
reply other threads:[~2026-06-01 11:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=178031462454.1.1719142238580110795.rpms-snakemake-6d34ef7dec9e@fedoraproject.org \
--to=code@musicinmybrain.net \
--cc=git-commits@fedoraproject.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