From 750935b239d76b3525f60b3fcc98b7eea7f4fed5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 15 Jul 2023 11:28:35 -0400 Subject: [PATCH] Initial package (close RHBZ#2222279) --- .gitignore | 1 + python-flexcache.spec | 67 +++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 69 insertions(+) create mode 100644 .gitignore create mode 100644 python-flexcache.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6745d93 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/flexcache-0.2.tar.gz diff --git a/python-flexcache.spec b/python-flexcache.spec new file mode 100644 index 0000000..c92162b --- /dev/null +++ b/python-flexcache.spec @@ -0,0 +1,67 @@ +Name: python-flexcache +Version: 0.2 +Release: %autorelease +Summary: Cache on disk the result of expensive calculations + +License: BSD-3-Clause +URL: https://github.com/hgrecco/flexcache +Source: %{pypi_source flexcache} + +BuildArch: noarch + +BuildRequires: python3-devel + +%global common_description %{expand: +A robust and extensible package to cache on disk the result of expensive +calculations.} + +%description %{common_description} + + +%package -n python3-flexcache +Summary: %{summary} + +%description -n python3-flexcache %{common_description} + + +%prep +%autosetup -n flexcache-%{version} +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +sed -r -i 's/^([[:blank:]]*)("pytest-cov")/\1# \2/' pyproject.toml + + +%generate_buildrequires +%pyproject_buildrequires -x test + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files flexcache + +# Upstream probably doesn’t want to install flexcache.testsuite, but we don’t +# know how to suggest a fix given “[BUG] options.packages.find.exclude not +# taking effect when include_package_data = True”, +# https://github.com/pypa/setuptools/issues/3260. +# +# Still, we don’t want to install the test suite, so we just remove the files +# manually for now. +rm -rvf '%{buildroot}%{python3_sitelib}/flexcache/testsuite' +sed -r -i '/\/flexcache\/testsuite/d' %{pyproject_files} + + +%check +%pytest + + +%files -n python3-flexcache -f %{pyproject_files} +# pyproject_files handles AUTHORS and LICENSE; verify with “rpm -qL -p …” +%doc README.rst +%doc CHANGES + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..bf2b8f3 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (flexcache-0.2.tar.gz) = d06f854e32ee8b5449e695bb51968f5b674fe32f553d8357c1854b90d200cdde6d48c8d91ddce121b7cd2b1fd7d3b12cc91e708ebd9f4a1b5d622610c9302321