From f2c877989eaad4f41f62b0510a057cf868d71c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 20 Nov 2023 13:19:18 +0100 Subject: [PATCH] Initial package forked from EPEL 9 This has been forked from https://src.fedoraproject.org/rpms/python-flit-core/tree/3196f17ff405c1d7ae7dbda082b248927681b55b Changes initially proposed via https://src.fedoraproject.org/rpms/python-flit-core/pull-request/12 --- .gitignore | 22 ++++++++++ python-flit-core.spec | 98 +++++++++++++++++++++++++++++++++++++++++++ sources | 1 + tests/tests.yml | 17 ++++++++ 4 files changed, 138 insertions(+) create mode 100644 python-flit-core.spec create mode 100644 sources create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..de738f7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,22 @@ +/flit-0.9.tar.gz +/flit-0.11.1.tar.gz +/flit-0.11.4.tar.gz +/flit-0.12.tar.gz +/flit-0.12.1.tar.gz +/flit-0.12.2.tar.gz +/flit-0.13.tar.gz +/flit-1.0.tar.gz +/flit-1.1.tar.gz +/flit-1.3.tar.gz +/flit-2.1.0.tar.gz +/flit-2.2.0.tar.gz +/flit-2.3.0.tar.gz +/flit-3.0.0.tar.gz +/flit-3.2.0.tar.gz +/flit-3.3.0.tar.gz +/flit-3.4.0.tar.gz +/flit-3.5.1.tar.gz +/flit-3.7.1.tar.gz +/flit-3.8.0.tar.gz +/flit_core-3.8.0.tar.gz +/flit_core-3.9.0.tar.gz diff --git a/python-flit-core.spec b/python-flit-core.spec new file mode 100644 index 0000000..24a8a7e --- /dev/null +++ b/python-flit-core.spec @@ -0,0 +1,98 @@ +# Tests are disabled by default, unless on EPEL. +# We don't have testpath in RHEL 9. +%bcond tests %{defined epel} + +Name: python-flit-core +Version: 3.9.0 +Release: 5%{?dist} +Summary: PEP 517 build backend for packages using Flit + +# flit-core is BSD-3-Clause +# flit_core/versionno.py contains a regex that is from packaging, BSD-2-Clause +License: BSD + +URL: https://flit.pypa.io/ +Source: %{pypi_source flit_core} + +BuildArch: noarch +BuildRequires: python3-devel + +%if %{with tests} +BuildRequires: python3-pytest +# Test deps that require flit-core to build: +BuildRequires: python3-testpath +%endif + +%global _description %{expand: +This provides a PEP 517 build backend for packages using Flit. +The only public interface is the API specified by PEP 517, +at flit_core.buildapi.} + +%description %_description + + +%package -n python3-flit-core +Summary: %{summary} +Conflicts: python3-flit < 2.1.0-2 + +%description -n python3-flit-core %_description + + +%prep +%autosetup -p1 -n flit_core-%{version} +# Add tomli to build-system.requires and project.dependencies to account for +# our tomli unbundling. +# tomllib is a part of standard library since Python 3.11, so we only need this +# for python_version<'3.11'. +sed -i 's/^\(dependencies\|requires\) = \[\]/\1 = ["tomli; python_version<'\'3.11\''"]/' pyproject.toml + +# Remove vendored tomli that flit_core includes to solve the circular dependency on older Pythons +# (flit_core requires tomli, but flit_core is needed to build tomli). +rm -rf flit_core/vendor + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + +%install +%pyproject_install + +# don't ship tests in flit_core package +# if upstream decides to change the installation, it can be removed: +# https://github.com/takluyver/flit/issues/403 +rm -r %{buildroot}%{python3_sitelib}/flit_core/tests/ + +%check +%py3_check_import flit_core flit_core.buildapi +%if %{with tests} +%pytest +%endif + + +%files -n python3-flit-core +%license LICENSE +%doc README.rst +%{python3_sitelib}/flit_core-*.dist-info/ +%{python3_sitelib}/flit_core/ + + +%changelog +* Mon Oct 16 2023 Miro Hrončok - 3.9.0-5 +- Initial package for RHEL 9 +- Resolves: RHEL-12338 +- Fedora+EPEL contributions by: + Charalampos Stratakis + Igor Gnatenko + Karolina Surma + Lumir Balhar + Maxwell G + Michel Alexandre Salim + Miro Hrončok + Mukundan Ragavan + Tomáš Hrnčiar + Yaakov Selkowitz diff --git a/sources b/sources new file mode 100644 index 0000000..80a2866 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (flit_core-3.9.0.tar.gz) = 1205589930d2c51d6aa6b2533a122a912e63b157e94adba2a0649a58d324fa98a5b84609d9b53e9d236f1cdb6a6984de2cefcf2f11abc2cd83956df21f269ad6 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..e7f5670 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,17 @@ +--- +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + repositories: + - repo: "https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git" + dest: "pyproject-rpm-macros" + tests: + - pyproject_entrypoints: + dir: pyproject-rpm-macros/tests + run: ./mocktest.sh python-entrypoints + required_packages: + - mock + - rpmdevtools + - rpm-build