%global upstream_name numba Name: python-%{upstream_name} Version: 0.64.0 Release: 1%{?dist} Summary: NumPy-aware just-in-time compiler for Python # Two-clause: the LICENSE file carries the redistribution and binary-form # conditions and no "neither the name" clause. License: BSD-2-Clause URL: https://numba.pydata.org/ Source0: https://files.pythonhosted.org/packages/source/n/%{upstream_name}/%{upstream_name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: python3-setuptools # The version pairing is the whole reason this is 0.64.0 rather than current. # numba is locked to one llvmlite minor: 0.64.0 wants >= 0.46.0dev0, < 0.47, and # Fedora 44 ships llvmlite 0.46.0. The newest numba (0.67.0) wants llvmlite # >= 0.49, which would mean bumping llvmlite -- and llvmlite is itself pinned to # a particular LLVM. 0.64.0 is the newest numba that needs none of that, and it # still supports Python 3.14 (setup.py: max_python_version = "3.15", exclusive). BuildRequires: python3-llvmlite >= 0.46.0 BuildRequires: python3-llvmlite < 0.47.0 # setup.py's min_numpy_build_version is 2.0.0rc1; run-time range is [1.22, 2.5). BuildRequires: python3-numpy >= 2.0.0 # Only needed so %%check can import numba.misc.dump_style, which raises # ImportError without it. Also a Recommends below: it is what makes # numba's syntax-highlighted IR dumps work. BuildRequires: python3-pygments %global _description %{expand: Numba translates a subset of Python and NumPy code into fast machine code at run time, using LLVM. Decorating a function with @jit compiles it on first call; numerical code written in plain Python and NumPy can then run at speeds comparable to C or Fortran, without rewriting it in another language.} %description %_description %package -n python3-%{upstream_name} Summary: %{summary} # numba refuses to import against an llvmlite outside its supported window, so # the runtime bound matters as much as the build one. The generated dependency # already encodes it; this is here to make the coupling visible to anyone # reading the spec before bumping either package. Requires: python3-llvmlite >= 0.46.0 Requires: python3-llvmlite < 0.47.0 # Optional: without it numba works, but the highlighted IR/assembly dumps # (NUMBA_DUMP_*) raise ImportError instead of printing. Recommends: python3-pygments %description -n python3-%{upstream_name} %_description %prep %autosetup -n %{upstream_name}-%{version} -p1 # TBB is picked up implicitly if its headers happen to be in the buildroot, # which would make the set of shipped extension modules depend on what else got # pulled in. Disable it explicitly so the build is reproducible. The OpenMP and # workqueue threading layers remain; adding tbb-devel plus dropping this line is # all that enabling it would take. export NUMBA_DISABLE_TBB=1 %generate_buildrequires %pyproject_buildrequires %build export NUMBA_DISABLE_TBB=1 %pyproject_wheel %install export NUMBA_DISABLE_TBB=1 %pyproject_install %pyproject_save_files -l %{upstream_name} %check # Import every installed module, which is what proves the extension modules # loaded and the generated Requires are complete. # # Excluded, each for a reason that is not a packaging defect: # numba.cuda / numba.roc — toolkit bindings that probe for a driver at import # numba.misc.gdb_print_extension — does "import gdb", which only resolves # inside a gdb session; there is no importable gdb module on the system # numba.tests.* — the test corpus, including # pycc_distutils_usecase/setup_*.py, which are setup.py scripts that import # sibling modules only present when run from their own directory # # Keep every -e on this one line. A backslash continuation here silently drops # the continued arguments: the macro expands only what is on its own line, and # the build then fails on modules you thought you had excluded. %pyproject_check_import -e 'numba.cuda*' -e 'numba.roc*' -e 'numba.testing*' -e 'numba.tests*' -e 'numba.misc.gdb_print_extension' # Importing numba proves almost nothing on its own -- the failure mode that # matters here is an llvmlite/LLVM mismatch, which only shows up when something # is actually compiled. So compile and run one function, and check the answer. # The full suite (python -m numba.runtests) takes well over an hour and is not # appropriate for a package build. # Run from %%{_builddir} so the unbuilt source tree is not on sys.path, and point # PYTHONPATH at the buildroot: %%pyproject_check_import arranges that itself, a # bare %%{python3} does not. cd %{_builddir} PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} -c " import numba, numpy as np @numba.njit def s(a): t = 0.0 for i in range(a.size): t += a[i] ** 2 return t x = np.arange(1000, dtype=np.float64) got, want = s(x), float((x ** 2).sum()) assert abs(got - want) < 1e-6, (got, want) print('numba', numba.__version__, 'JIT ok; llvmlite', __import__('llvmlite').__version__) " %files -n python3-%{upstream_name} -f %{pyproject_files} %doc README.rst CHANGE_LOG %license LICENSES.third-party %{_bindir}/numba %changelog * Mon Sep 14 2026 Morgan Hough - 0.64.0-1 - Initial package. numba is absent from Fedora entirely -- there is no python-numba or numba in dist-git -- and its absence is what makes both simnibs and babelbrain uninstallable in this COPR, despite each having built green since June. - Packaged at 0.64.0 rather than the current 0.67.0 deliberately. numba is locked to a single llvmlite minor; 0.64.0 wants llvmlite [0.46, 0.47) and Fedora 44 ships exactly 0.46.0, so this needs no new dependency at all. 0.67.0 would require llvmlite >= 0.49, and llvmlite is in turn pinned to a specific LLVM, so taking the newest numba would mean carrying a two-package chain. 0.64.0 is the newest release that avoids it and still supports Python 3.14. - Disable the TBB threading layer explicitly. setup.py enables it merely if TBB headers are visible, which would let an unrelated buildroot change alter the set of shipped extension modules. - %%check compiles and runs a jitted function rather than only importing, since an llvmlite/LLVM mismatch is invisible to an import and only appears when something is actually compiled. - Build-require and recommend pygments: numba.misc.dump_style raises ImportError without it, and it is what makes the NUMBA_DUMP_* highlighted dumps work.