public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/snakemake] f44: Patch for PEP 661 sentinels; fixes RHBZ#2483710
@ 2026-06-01 11:50 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-06-01 11:50 UTC (permalink / raw)
  To: git-commits

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-01 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-01 11:50 [rpms/snakemake] f44: Patch for PEP 661 sentinels; fixes RHBZ#2483710 Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox