public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python-huggingface-hub] rawhide: Fix FTBFS with Python 3.15 (rhbz#2481411)
Date: Mon, 08 Jun 2026 09:53:00 GMT [thread overview]
Message-ID: <178091238095.1.16101532048902184775.rpms-python-huggingface-hub-866193ab7cae@fedoraproject.org> (raw)
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
reply other threads:[~2026-06-08 9:53 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=178091238095.1.16101532048902184775.rpms-python-huggingface-hub-866193ab7cae@fedoraproject.org \
--to=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