From 037a5f3831e7b2f91135c4a251882393f610b249 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 18 Sep 2024 14:08:59 +0200 Subject: [PATCH] Simplify the packaging Signed-off-by: Cristian Le --- python-jaraco-functools.spec | 52 +++++++++++++++++------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/python-jaraco-functools.spec b/python-jaraco-functools.spec index f33246f..2879872 100644 --- a/python-jaraco-functools.spec +++ b/python-jaraco-functools.spec @@ -1,86 +1,82 @@ # Created by pyp2rpm-3.3.2 -%global pypi_name jaraco_functools -%global pkg_name jaraco-functools # Fedora doesn't have all the docs deps yet %bcond_with docs -Name: python-%{pkg_name} +Name: python-jaraco-functools Version: 4.0.2 Release: %autorelease Summary: Functools like those found in stdlib License: MIT URL: https://github.com/jaraco/jaraco.functools -Source0: %{pypi_source %{pypi_name}} +Source0: %{pypi_source jaraco_functools} BuildArch: noarch %description Functools like those found in stdlib -%package -n python3-%{pkg_name} +%package -n python3-jaraco-functools Summary: %{summary} -# python3-jaraco is an RPM-only namespace package for jaraco.* -# it does not exists on PyPI and does not provide python3dist(jaraco) -# DO NOT change this dependency to python3dist(jaraco) or similar -Requires: python3-jaraco - BuildRequires: python3-devel -BuildConflicts: python3dist(pytest) = 3.7.3 -BuildRequires: python3dist(jaraco-classes) -BuildRequires: python3dist(pip) >= 3.4 -BuildRequires: python3dist(pytest) >= 3.4 -BuildRequires: python3dist(setuptools) - -%{?python_provide:%python_provide python3-%{pkg_name}} +BuildRequires: tomcli -%description -n python3-%{pkg_name} +%description -n python3-jaraco-functools Functools like those found in stdlib %if %{with docs} -%package -n python-%{pkg_name}-doc +%package -n python-jaraco-functools-doc Summary: jaraco-functools documentation BuildRequires: python3dist(jaraco-packaging) >= 3.2 BuildRequires: python3dist(rst-linker) >= 1.9 BuildRequires: python3dist(sphinx) -%description -n python-%{pkg_name}-doc +%description -n python-jaraco-functools-doc Documentation for jaraco-functools %endif + %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -n jaraco_functools-%{version} +# Remove dev-only dependencies. Upstream later split the `test` dependencies out of it +# https://github.com/jaraco/skeleton/issues/138 +tomcli set pyproject.toml lists delitem "project.optional-dependencies.test" "pytest-.*" + + %generate_buildrequires -%pyproject_buildrequires +%pyproject_buildrequires -x test + %build %pyproject_wheel %if %{with docs} # generate html docs -PYTHONPATH=${PWD} sphinx-build docs html +%{python3} -m sphinx docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %endif + %install %pyproject_install +%pyproject_save_files -l jaraco + %check %pytest -%files -n python3-%{pkg_name} -%license LICENSE + +%files -n python3-jaraco-functools -f %{pyproject_files} %doc README.rst -%{python3_sitelib}/jaraco/functools* -%{python3_sitelib}/jaraco.functools-%{version}.dist-info %if %{with docs} -%files -n python-%{pkg_name}-doc +%files -n python-jaraco-functools-doc %doc html %license LICENSE %endif + %changelog %autochangelog