Blame SPECS/python-meson-python.spec

b3a79c
%bcond tests 1
b3a79c
# The python-pytest-mock dependency is unwanted on RHEL; we can omit it and
b3a79c
# still run most of the tests.
b3a79c
%bcond pytest_mock %{undefined rhel}
b3a79c
# RHEL will not have patchelf (which is used for adjusting RPATH in shared
b3a79c
# libraries bundled in wheels); that is OK because the package is
b3a79c
# buildroot-only there and the packages built with python-meson-python will not
b3a79c
# bundle shared libraries. In Fedora and EPEL, we must depend on patchelf to
b3a79c
# ship a full-featured package.
b3a79c
%bcond patchelf 1
b3a79c
b3a79c
Name:           python-meson-python
b3a79c
Summary:        Meson Python build backend (PEP 517)
b3a79c
Version:        0.17.1
b3a79c
Release:        2%{?dist}
b3a79c
b3a79c
# SPDX
b3a79c
License:        MIT
b3a79c
URL:            https://github.com/mesonbuild/meson-python
b3a79c
Source:         %{pypi_source meson_python}
b3a79c
b3a79c
# Downstream-only patch to remove the patchelf dependency (and corresponding
b3a79c
# functionality), controlled by the patchelf build conditional
b3a79c
Patch100:         meson_python-remove-patchelf.patch
b3a79c
b3a79c
BuildArch:      noarch
b3a79c
b3a79c
BuildRequires:  python3-devel
b3a79c
b3a79c
%if %{with tests}
b3a79c
BuildRequires:  gcc
b3a79c
BuildRequires:  git-core
b3a79c
%endif
b3a79c
b3a79c
%global common_description %{expand:
b3a79c
meson-python is a Python build backend built on top of the Meson build system.
b3a79c
It enables to use Meson for the configuration and build steps of Python
b3a79c
packages. Meson is an open source build system meant to be both extremely fast,
b3a79c
and, even more importantly, as user friendly as possible. meson-python is best
b3a79c
suited for building Python packages containing extension modules implemented in
b3a79c
languages such as C, C++, Cython, Fortran, Pythran, or Rust. Consult the
b3a79c
documentation for more details.}
b3a79c
b3a79c
%description %{common_description}
b3a79c
b3a79c
b3a79c
%package -n     python3-meson-python
b3a79c
Summary:        %{summary}
b3a79c
b3a79c
# When patchelf is not in the PATH, mesonpy.get_requires_for_build_wheel() adds
b3a79c
# https://pypi.org/project/patchelf/ to the dependencies. We always want to use
b3a79c
# the system patchelf.
b3a79c
%if %{with patchelf}
b3a79c
BuildRequires:  /usr/bin/patchelf
b3a79c
Requires:       /usr/bin/patchelf
b3a79c
%endif
b3a79c
b3a79c
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides_for_importable_modules
b3a79c
%py_provides    python3-mesonpy
b3a79c
b3a79c
%description -n python3-meson-python %{common_description}
b3a79c
b3a79c
b3a79c
%prep
b3a79c
# We need “-S git” because test_reproducible uses “meson dist,” which only
b3a79c
# works in a git or mercurial repo.
b3a79c
%autosetup -n meson_python-%{version} -N -S git
b3a79c
%autopatch -M 99 -p1
b3a79c
%if %{without patchelf}
b3a79c
%patch 100 -p1
b3a79c
%endif
b3a79c
# build: used only by skipped PEP 518 test
b3a79c
# pytest-cov: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
b3a79c
sed -r -i "s/^  '(build|pytest-cov)/#&/" pyproject.toml
b3a79c
%if %{without pytest_mock}
b3a79c
sed -r -i "s/^  '(pytest-mock)/#&/" pyproject.toml
b3a79c
%endif
b3a79c
b3a79c
b3a79c
%generate_buildrequires
b3a79c
%pyproject_buildrequires -w %{?with_tests:-x test}
b3a79c
b3a79c
b3a79c
%build
b3a79c
%pyproject_wheel
b3a79c
b3a79c
b3a79c
%install
b3a79c
%pyproject_install
b3a79c
%pyproject_save_files mesonpy
b3a79c
b3a79c
b3a79c
%check
b3a79c
%if %{with tests}
b3a79c
# Note: tests are *not* safe for parallel execution with pytest-xdist.
b3a79c
b3a79c
# PEP 518 tests require network access.
b3a79c
ignore="${ignore-} --ignore=tests/test_pep518.py"
b3a79c
b3a79c
%if %{without pytest_mock}
b3a79c
k="${k-}${k+ and }not test_invalid_build_dir"
b3a79c
k="${k-}${k+ and }not test_use_ansi_escapes"
b3a79c
%endif
b3a79c
%if %{without patchelf}
b3a79c
k="${k-}${k+ and }not test_contents"
b3a79c
k="${k-}${k+ and }not test_local_lib"
b3a79c
k="${k-}${k+ and }not test_rpath"
b3a79c
k="${k-}${k+ and }not test_get_requires_for_build_wheel"
b3a79c
k="${k-}${k+ and }not test_uneeded_rpath"
b3a79c
%endif
b3a79c
b3a79c
%pytest ${ignore-} -k "${k-}"
b3a79c
b3a79c
%else
b3a79c
%pyproject_check_import
b3a79c
%endif
b3a79c
b3a79c
b3a79c
%files -n python3-meson-python -f %{pyproject_files}
b3a79c
# LICENSE duplicates LICENSES/MIT.txt. Currently, neither is automatically
b3a79c
# installed into the dist-info metadata directory.
b3a79c
%license LICENSES/*
b3a79c
%doc CHANGELOG.rst
b3a79c
%doc README.rst
b3a79c
b3a79c
b3a79c
%changelog
b3a79c
* Tue Nov 05 2024 Joel Capitao <jcapitao@redhat.com> - 0.17.1-2
b3a79c
- Enable patchelf condition
b3a79c
b3a79c
* Sat Oct 26 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.17.1-1
b3a79c
- Update to 0.17.1 (close RHBZ#2321782)
b3a79c
b3a79c
* Mon Oct 21 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.17.0-1
b3a79c
- Update to 0.17.0 (close RHBZ#2320393)
b3a79c
b3a79c
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-10
b3a79c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
b3a79c
b3a79c
* Fri Jun 07 2024 Pavel Simovec <psimovec@redhat.com> - 0.16.0-5
b3a79c
- Remove patchelf dependency for RHEL
b3a79c
b3a79c
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.16.0-4
b3a79c
- Rebuilt for Python 3.13
b3a79c
b3a79c
* Thu May 09 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.16.0-3
b3a79c
- Omit pytest-mock test dependency and associated tests on RHEL
b3a79c
b3a79c
* Sat Apr 20 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.16.0-2
b3a79c
- Patch for pyproject-metadata 0.8.0
b3a79c
b3a79c
* Wed Apr 17 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.16.0-1
b3a79c
- Update to 0.16.0 (close RHBZ#2275469)
b3a79c
b3a79c
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-4
b3a79c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
b3a79c
b3a79c
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-3
b3a79c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
b3a79c
b3a79c
* Fri Dec 01 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.15.0-2
b3a79c
- Drop unused python-build dependency
b3a79c
b3a79c
* Wed Nov 01 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.15.0-1
b3a79c
- Update to 0.15.0 (close RHBZ#2246309)
b3a79c
b3a79c
* Tue Sep 05 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.14.0-1
b3a79c
- Update to 0.14.0 (close RHBZ#2237380)
b3a79c
b3a79c
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.2-3
b3a79c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
b3a79c
b3a79c
* Fri Jul 07 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.2-2
b3a79c
- Use new (rpm 4.17.1+) bcond style
b3a79c
b3a79c
* Wed Jun 28 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.2-1
b3a79c
- Update to 0.13.2 (close RHBZ#2218115)
b3a79c
b3a79c
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.13.1-4
b3a79c
- Rebuilt for Python 3.12
b3a79c
b3a79c
* Sun Apr 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.1-3
b3a79c
- Depend on the system patchelf
b3a79c
- This avoids generating dependencies on python3dist(patchelf).
b3a79c
b3a79c
* Sun Apr 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.1-2
b3a79c
- Let the dist-git branches diverge; drop the spec-file conditionals
b3a79c
b3a79c
* Sun Apr 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.13.1-1
b3a79c
- Initial package (close RHBZ#2192109)