From 3aaf2e8c69fee37993598d58dc6773dd462651e4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 29 Apr 2023 20:15:23 -0400 Subject: [PATCH] Initial package (close RHBZ#2192109) --- .gitignore | 1 + python-meson-python.spec | 93 ++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 95 insertions(+) create mode 100644 .gitignore create mode 100644 python-meson-python.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51713d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/meson_python-0.13.1.tar.gz diff --git a/python-meson-python.spec b/python-meson-python.spec new file mode 100644 index 0000000..187b0cd --- /dev/null +++ b/python-meson-python.spec @@ -0,0 +1,93 @@ +%bcond_without tests + +Name: python-meson-python +Summary: Meson Python build backend (PEP 517) +Version: 0.13.1 +Release: %autorelease + +# SPDX +License: MIT +URL: https://github.com/mesonbuild/meson-python +Source: %{pypi_source meson_python} + +BuildArch: noarch + +BuildRequires: python3-devel + +%if %{with tests} +BuildRequires: gcc +BuildRequires: git-core +%endif + +%global common_description %{expand: +meson-python is a Python build backend built on top of the Meson build system. +It enables to use Meson for the configuration and build steps of Python +packages. Meson is an open source build system meant to be both extremely fast, +and, even more importantly, as user friendly as possible. meson-python is best +suited for building Python packages containing extension modules implemented in +languages such as C, C++, Cython, Fortran, Pythran, or Rust. Consult the +documentation for more details.} + +%description %{common_description} + + +%package -n python3-meson-python +Summary: %{summary} + +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides_for_importable_modules +%py_provides python3-mesonpy + +%description -n python3-meson-python %{common_description} + + +%prep +%autosetup -n meson_python-%{version} + +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +sed -r -i "s/'pytest-cov/# &/" pyproject.toml + +%if 0%{?fc37} || 0%{?fc38} +# Cython lower bound is for Python 3.12 support, so it is safe to remove. +sed -r -i "s/('cython)[[:blank:]]*>=.*'/\\1'/" pyproject.toml +%endif +%if 0%{?fc37} +# We must work with what we have. The lower bound was updated from 0.6.1 only +# to fix a Windows bug, anyway, so there should be no reason not to loosen it. +# https://github.com/mesonbuild/meson-python/pull/269 +sed -r -i "s/('pyproject-metadata)[[:blank:]]*>=.*'/\\1'/" pyproject.toml +%endif + + +%generate_buildrequires +%pyproject_buildrequires -w %{?with_tests:-x test} + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files mesonpy + + +%check +%if %{with tests} +# PEP 518 tests require network access. +# Note: tests are *not* safe for parallel execution with pytest-xdist. +%pytest --ignore=tests/test_pep518.py +%else +%pyproject_check_import +%endif + + +%files -n python3-meson-python -f %{pyproject_files} +# LICENSE duplicates LICENSES/MIT.txt. Currently, neither is automatically +# installed into the dist-info metadata directory. +%license LICENSES/* +%doc CHANGELOG.rst +%doc README.rst + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..cb42ab7 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (meson_python-0.13.1.tar.gz) = 6cfe9a09fd4e28797cf83dab3f51ef8f2c8f4a8fff83449d6391f18be75d701790f38aeb5a0b8a41f2b886fd6d0bd070d837652bb5cd1164564873b651b886fd