public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-huggingface-hub] rawhide: Fix FTBFS with Python 3.15 (rhbz#2481411)
@ 2026-06-08  9:53 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-08  9:53 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-huggingface-hub
            Branch : rawhide
            Commit : 866193ab7cae939e4343c05c418841f4b7135601
            Author : Miroslav Suchý <msuchy@redhat.com>
            Date   : 2026-06-08T11:52:50+02:00
            Stats  : +22/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-huggingface-hub/c/866193ab7cae939e4343c05c418841f4b7135601?branch=rawhide

            Log:
            Fix FTBFS with Python 3.15 (rhbz#2481411)

Python 3.15 removed private _MISSING_TYPE from dataclasses module.
Patch uses try/except fallback with type(MISSING) which produces
the identical type object on all Python versions.

- Chose try/except over unconditional type(MISSING) to preserve
  original import on older Pythons where _MISSING_TYPE exists

Resolves: rhbz#2481411

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>

---
diff --git a/fix-python315-missing-type.patch b/fix-python315-missing-type.patch
new file mode 100644
index 0000000..7ec8f58
--- /dev/null
+++ b/fix-python315-missing-type.patch
@@ -0,0 +1,17 @@
+--- a/src/huggingface_hub/dataclasses.py
++++ b/src/huggingface_hub/dataclasses.py
+@@ -2,7 +2,13 @@ import collections.abc
+ import inspect
+ import types
+ from collections.abc import Callable
+-from dataclasses import _MISSING_TYPE, MISSING, Field, field, fields, make_dataclass
++from dataclasses import MISSING, Field, field, fields, make_dataclass
++
++try:
++    from dataclasses import _MISSING_TYPE
++except ImportError:
++    # Python 3.15+ removed _MISSING_TYPE
++    _MISSING_TYPE = type(MISSING)
+ from functools import lru_cache, wraps
+ from typing import (
+     Annotated,

diff --git a/python-huggingface-hub.spec b/python-huggingface-hub.spec
index 1c70ff6..95f9415 100644
--- a/python-huggingface-hub.spec
+++ b/python-huggingface-hub.spec
@@ -7,6 +7,11 @@ License:        Apache-2.0
 URL:            https://github.com/huggingface/huggingface_hub
 Source:         %{pypi_source huggingface_hub}
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=2481411
+# https://github.com/huggingface/huggingface_hub/pull/4322
+# Python 3.15 removed private _MISSING_TYPE from dataclasses module
+Patch0:         fix-python315-missing-type.patch
+
 BuildArch:      noarch
 BuildRequires:  python3-devel
 

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

only message in thread, other threads:[~2026-06-08  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08  9:53 [rpms/python-huggingface-hub] rawhide: Fix FTBFS with Python 3.15 (rhbz#2481411) 

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