%global pypi_name transformers Name: python-transformers # f44 ships tokenizers 0.22.2 and safetensors 0.7.0; 5.13.0 raised the # safetensors floor to 0.8.0 and 5.16.0 raised the tokenizers floor to 0.23.1, # so 5.12.1 is the newest release that installs there (tokenizers <=0.23.0,>=0.22.0; # safetensors >=0.4.3). f45 and rawhide have 0.23.1 / 0.8.0 and take 5.17.0. %global ver_f44 5.12.1 %global ver_f45 5.17.0 # BOTH tarballs are Sources, and %%prep picks one with -T -b. COPR builds a single # SRPM in its own builder environment, where %%{fedora} is NOT the target chroot's, # so a Version conditional on %%{fedora} alone gave an SRPM carrying only the 5.12.1 # tarball; the f45 and rawhide rebuilds then evaluated the other branch and failed # with "Bad file: transformers-5.17.0.tar.gz: No such file or directory" # (11079953, 11079956, 11079964, 11079966). Same shape python-numba.spec solves. %if 0%{?fedora} >= 45 Version: %{ver_f45} %global srcnum 1 %else Version: %{ver_f44} %global srcnum 0 %endif Release: 4%{?dist} Summary: State-of-the-art machine learning for PyTorch, TensorFlow and JAX License: Apache-2.0 URL: https://github.com/huggingface/transformers Source0: %{pypi_source %{pypi_name} %{ver_f44}} Source1: %{pypi_source %{pypi_name} %{ver_f45}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %global _description %{expand: Transformers provides pretrained models for text, vision, audio and multimodal tasks, together with the tokenizer, configuration and pipeline machinery to load and run them. It is backend-agnostic: PyTorch, TensorFlow and JAX are all optional, and none is required to install this package. Model weights are not included. They are downloaded from the Hugging Face Hub on first use.} %description %{_description} %package -n python3-transformers Summary: %{summary} # Not a dependency, deliberately. transformers is usable without any of them, # and which one a user wants depends entirely on the model they are running. # python3-torch is the one f45 actually has. # UNDECLARED UPSTREAM DEPENDENCY. transformers/cli/chat.py line 26 is a bare # `import requests` at module scope, and /usr/bin/transformers imports that module # on startup, so the installed command dies with ModuleNotFoundError without it. # Neither 5.12.1 nor 5.17.0 lists requests in its metadata. It looked fine on # rawhide only because other packages in that chroot happened to pull requests in. Requires: python3-requests Recommends: python3-torch %description -n python3-transformers %{_description} %prep # -T suppresses the default Source0 unpack and -b picks the tarball matching the # Version this chroot resolved; without -T, %%autosetup lays down the f44 tree and # then cd's into the f45 one. %autosetup -n %{pypi_name}-%{version} -T -b %{srcnum} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files transformers %check # -t restricts this to the TOP-LEVEL module. The package ships 2701 python # files, and the great majority of its submodules import an optional backend at # module scope -- torch, tensorflow, jax, flax, a specific tokenizer, or a # model-specific library. Importing all of them would not test this package; it # would test which optional backends happen to be installed in the buildroot, # and would fail on every model whose extra Fedora does not carry. # # The compiled parts of this stack are NOT here: they live in the separate # tokenizers and safetensors projects, both already in f45, so there is no # extension module in this package whose load needs proving. %pyproject_check_import -t %files -n python3-transformers -f %{pyproject_files} %license LICENSE %doc README.md # The console script is declared in pyproject.toml's [project.scripts] but does # not land in %%{pyproject_files}, so it has to be listed by hand or the build # fails with "Installed (but unpackaged) file(s) found: /usr/bin/transformers". %{_bindir}/transformers %changelog * Mon Oct 05 2026 Morgan Hough - %{version}-4 - Ship BOTH tarballs (Source0 5.12.1, Source1 5.17.0) and unpack the one that matches the chroot with -T -b, as python-numba.spec does. -3 failed on f45 and rawhide, all four chroots, with "Bad file: transformers-5.17.0.tar.gz: No such file or directory": COPR builds one SRPM in its own environment, where %%{fedora} is not the target chroot's, so the SRPM carried only the 5.12.1 tarball and the chroot rebuild, evaluating the other branch of the Version conditional, wanted one that was not there. f44 passed because its branch happened to match. - The -3 change (Requires: python3-requests) is unchanged and still needed. * Mon Oct 05 2026 Morgan Hough - %{version}-3 - Requires: python3-requests. The installed /usr/bin/transformers failed with "ModuleNotFoundError: No module named 'requests'" on f44 (5.12.1), because transformers/cli/chat.py imports requests at module scope and neither 5.12.1 nor 5.17.0 declares it. The same defect is latent in 5.17.0 on f45 and rawhide; it passed there only because other packages in the test chroot pulled requests in. Found by running the CLI, not by %%check, which uses -t (top-level import only). * Sun Oct 04 2026 Morgan Hough - 5.12.1-2 - f44 builds 5.12.1; f45 and rawhide keep 5.17.0. The f44 builds of 5.17.0 (11074443, 11074445) failed in dependency resolution: "No match for argument: python3dist(safetensors) >= 0.8" and "nothing provides ... tokenizers >= 0.23.1", because f44 has safetensors 0.7.0 and tokenizers 0.22.2. 5.12.1 is the newest release inside both pins. Packaging newer Rust-built tokenizers and safetensors for f44 would be a wave of its own and was not attempted. - f45/rawhide are unchanged apart from the release number; they were not rebuilt. * Tue Sep 29 2026 Morgan Hough - 5.17.0-1 - Initial package: transformers 5.17.0, a dependency of Project-MONAI/monai-physio. - Pure Python, noarch: zero .c/.cpp/.cu/.pyx/.rs files in the 9.4 MB sdist, and the published wheel is py3-none-any. The compiled parts of the HuggingFace stack are in the separate tokenizers and safetensors projects, both already packaged for f45. - requires-python is ">=3.10.0" with no upper bound, so f45's Python 3.15 is in range. Its classifiers stop at 3.14, but a classifier is not a cap. - All nine core runtime dependencies were already in f45: huggingface-hub, numpy, packaging, pyyaml, regex, tokenizers, typer, safetensors, tqdm. - WATCH THE TOKENIZERS PIN. Upstream requires tokenizers >=0.23.1,<0.24.0 and f45 ships exactly 0.23.1 -- the floor. A tokenizers bump in Fedora past 0.24.0 breaks this package, and nothing in our own gates would notice until something imported it. - No backend is required. torch, tensorflow and jax are all optional extras; python3-torch is a Recommends only. - /usr/bin/transformers is listed explicitly in %%files: the entry point is declared in pyproject.toml but %%pyproject_save_files does not emit it, and the build fails on the unpackaged file without it. - %%check is -t (top level only) on purpose: most of the 2701 modules import an optional backend at module scope, so a full import sweep would test which extras are in the buildroot rather than testing this package.