# Rebased from Fedora's python-llvmlite.spec (rawhide, 0.48.0) -- same structure, # same LLVM 22 handling, same test deselections. Only the version differs, plus an # explicit Release instead of %%{autorelease} so ci/check-stale-served.sh can compare # what is served against what the spec says (it cannot evaluate %%autorelease). # # This is an INCOMPATIBLE OVERRIDE in the sense of docs/PACKAGING-POLICY.md: it # replaces Fedora's python3-llvmlite. The exposure was measured, not assumed -- # nothing in Fedora 45 requires python3-llvmlite at all. %bcond tests 1 # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond doc_pdf 1 # Latest (or only) version of LLVM supported upstream %global llvm_major 22 Name: python-llvmlite Version: 0.50.0~rc3 %global srcversion %(echo '%{version}' | tr -d '~') Release: 2%{?dist} Summary: Lightweight LLVM Python binding for writing JIT compilers # The entire source is BSD-2-Clause, except: # - The bundled versioneer.py, and the _version.py it generates (which is # packaged) is LicenseRef-Fedora-Public-Domain. In later versions of # versioneer, this becomes CC0-1.0 and then Unlicense. # Public-domain text added to fedora-license-data in commit # 830d88d4d89ee5596839de5b2c1f48426488841f: # https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/210 # - ffi/memorymanager.{h,cpp} are Apache-2.0 WITH LLVM-exception License: %{shrink: BSD-2-Clause AND Apache-2.0 WITH LLVM-exception AND LicenseRef-Fedora-Public-Domain } # Additionally, the following does not affect the license of the binary RPMs: # - conda-recipes/appveyor/run_with_env.cmd is CC0-1.0; for distribution in # the source RPM, it is covered by “Existing uses of CC0-1.0 on code files # in Fedora packages prior to 2022-08-01, and subsequent upstream versions # of those files in those packages, continue to be allowed. We encourage # Fedora package maintainers to ask upstreams to relicense such files.” # https://gitlab.com/fedora/legal/fedora-license-data/-/issues/91#note_1151947383 SourceLicense: %{license} AND CC0-1.0 URL: http://llvmlite.pydata.org/ %global forgeurl https://github.com/numba/llvmlite Source: %{forgeurl}/archive/v%{srcversion}/llvmlite-%{srcversion}.tar.gz BuildRequires: python3-devel BuildRequires: %{py3_dist pytest} BuildRequires: llvm-devel(major) = %{llvm_major} BuildRequires: gcc-c++ BuildRequires: cmake %global _description %{expand: llvmlite is a project originally tailored for Numba‘s needs, using the following approach: • A small C wrapper around the parts of the LLVM C++ API we need that are not already exposed by the LLVM C API. • A ctypes Python wrapper around the C API. • A pure Python implementation of the subset of the LLVM IR builder that we need for Numba.} %description %_description %package -n python3-llvmlite Summary: %{summary} # ffi/memorymanager.{h,cpp} are copied from an unspecified version of LLVM Provides: bundled(llvm) %description -n python3-llvmlite %_description %package doc Summary: Documentation for %{name} %if %{with doc_pdf} BuildRequires: make BuildRequires: %{py3_dist sphinx} BuildRequires: python3-sphinx-latex BuildRequires: latexmk # See docs/environment.yml: # The HTML theme is imported in conf.py even when not generating HTML BuildRequires: %{py3_dist sphinx_rtd_theme} %endif BuildArch: noarch %description doc %{summary}. %prep %autosetup -n llvmlite-%{srcversion} -p1 # Pin the version the wheel will declare, instead of letting versioneer guess it. # # llvmlite derives its version from git via versioneer (setup.py does # version=versioneer.get_version()). A release ARCHIVE carries no git history and # no baked version -- llvmlite/_version.py here is still the unexpanded template -- # so versioneer falls back and gets it wrong: building the v0.50.0rc3 archive # produced a wheel declaring 0.50.0rc1, shipping llvmlite-0.50.0rc1.dist-info and # therefore providing python3dist(llvmlite) = 0.50~rc1 out of a package whose rpm # version said 0.50.0~rc3. # # That mismatch is invisible until something depends on an exact version, and then # it misleads: numba's buildroot reported the llvmlite it needed as missing while # the rpm sat in the repo. Fedora does not hit this on final releases, but it is # wrong there too in principle -- the rpm version and the dist metadata should not # be able to disagree. sed -i "s/version=versioneer.get_version(),/version='%{srcversion}',/" setup.py grep -q "version='%{srcversion}'," setup.py || \ { echo "ERROR: could not pin the version in setup.py -- upstream changed it" >&2; exit 1; } # The line above fixes what the WHEEL declares. llvmlite.__version__ at RUNTIME is # a separate path: it comes from llvmlite/_version.py, which in an archive is the # unexpanded versioneer template. Left alone the installed module reports the wrong # version even once the rpm metadata is right -- and numba version-checks llvmlite # at import, so the string matters. Replace it with the same static form the PyPI # sdist ships (version_version + version_full + get_versions). cat > llvmlite/_version.py <<'VEREOF' # Static version file. Upstream generates this with versioneer from git metadata; # a release archive has no git, so the packaging writes it instead. Same shape as # the file in llvmlite's own PyPI sdist. version_version = '%{srcversion}' version_full = 'v%{srcversion}' def get_versions(default={}, verbose=False): return {'version': version_version, 'full': version_full} VEREOF python3 -c " import ast, sys src = open('llvmlite/_version.py').read() ast.parse(src) ns = {} exec(src, ns) got = ns['get_versions']()['version'] assert got == '%{srcversion}', 'version file says %%r, expected %{srcversion}' %% got print('_version.py pinned to', got) " # increase verbosity of tests to 2 sed -i 's/\(def run_tests.*verbosity=\)1/\12/' llvmlite/tests/__init__.py # Comment out to remove /usr/bin/env shebangs # Can use something similar to correct/remove /usr/bin/python shebangs also # find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';' # No network access echo 'intersphinx_mapping.clear()' >> docs/source/conf.py %generate_buildrequires %pyproject_buildrequires %build # See docs/source/admin-guide/install.rst. LLVM_CONFIG='%{_libdir}/llvm%{llvm_major}/bin/llvm-config' export CMAKE_PREFIX_PATH="$("${LLVM_CONFIG}" --cmakedir)/../" export LLVMLITE_SHARED=1 # https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html export VERBOSE=1 %pyproject_wheel %if %{with doc_pdf} %make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files -l llvmlite %check %if %{with tests} %ifarch riscv64 # Disable JIT tests on riscv64 since that feature is not supported # upstream yet. See: # https://github.com/numba/llvmlite/issues/923 # https://github.com/felixonmars/archriscv-packages/blob/master/python-llvmlite/riscv64.patch export PYTEST_ADDOPTS="\ --deselect llvmlite/tests/test_binding.py::TestMCJit \ --deselect llvmlite/tests/test_binding.py::TestGlobalConstructors \ --deselect llvmlite/tests/test_binding.py::TestObjectFile::test_add_object_file \ --deselect llvmlite/tests/test_binding.py::TestOrcLLJIT \ --deselect llvmlite/tests/test_binding.py::TestDylib::test_bad_library" %endif %ifarch %{ix86} s390x riscv64 # Test test_optsize_minsize fails on at least i686, s390x, and riscv64 # architectures # https://github.com/numba/llvmlite/issues/1449 k="${k-}${k+ and }not test_optsize_minsize" %endif %{pytest} -vv -k "${k-}" llvmlite/tests %endif %files -n python3-llvmlite -f %{pyproject_files} %doc CHANGE_LOG README.rst %files doc %license LICENSE LICENSE.thirdparty %doc examples/ %if %{with doc_pdf} %doc docs/_build/latex/llvmlite.pdf %endif %changelog * Sun Sep 27 2026 Morgan Hough - 0.50.0~rc3-2 - Pin llvmlite/_version.py too, not just setup.py's version=. __version__ is read from that file at runtime (llvmlite/__init__.py does get_versions()['version']), so fixing only the wheel metadata left the installed module still reporting 0.50.0rc1. - Release bump rather than a same-NVR rebuild, and that is the point: -1 was built twice with different contents, so dnf served a CACHED -1 to numba's buildroot and the JIT check kept printing llvmlite 0.50.0rc1 from a file I had already fixed. A rebuild at a fixed NVR reaches nobody -- see the same lesson recorded for opencv 5.0.0-5 in docs/COORDINATION.md. * Sun Sep 27 2026 Morgan Hough - 0.50.0~rc3-1 - New package in this COPR: llvmlite 0.50.0rc3, an OVERRIDE of Fedora's 0.48.0. numba 0.68.0rc1 is the first numba release that accepts Python 3.15, and it requires llvmlite >=0.50.0dev0,<0.51 -- so f45 and rawhide, which ship Python 3.15, cannot have numba at all until llvmlite 0.50 exists. Without numba, babelbrain and python3-simnibs BUILD on f45 and cannot be INSTALLED: both Requires: python3-numba, which is absent from Fedora entirely. - Why the override is cheap, measured rather than assumed: NOTHING in Fedora 45 requires python3-llvmlite. Checked under python3-llvmlite, python3.15dist(llvmlite) and python3dist(llvmlite), with a control query (whatrequires python3-numpy -> 293 results) proving the query works. So this replaces a Fedora package that no Fedora package depends on. - LLVM is unchanged: Fedora's 0.48.0 already builds against LLVM 22 (%%global llvm_major 22) and 0.50.0rc3's CMakeLists sets LLVMLITE_SUPPORTED_LLVM_VERSION_DEFAULT 22. f45 and rawhide both ship llvm22-devel 22.1.8 as a compat package, so no LLVM work is needed and the version check is NOT skipped. - %%prep pins the version setup.py declares. versioneer derives it from git, an archive has no git, and the fallback produced a wheel saying 0.50.0rc1 from the v0.50.0rc3 tarball -- so the rpm said ~rc3 while python3dist(llvmlite) said ~rc1. Nothing notices until a dependent needs an exact version, and then the error points at the wrong package. - Prerelease, deliberately: 0.50.0rc3 (2026-09-09) is the only 0.50 on PyPI. Upstream's recent rc-to-final gap is ~3-4 weeks for llvmlite, so 0.50.0 final is expected early October; the tilde in 0.50.0~rc3 sorts below it so the final supersedes this cleanly.