diff --git a/python-pyrsistent.spec b/python-pyrsistent.spec index 3848ea6b3d9e736828e4a8ed40008d31b31cf371..f54e256469d9d09e42001c6455b89da05c507f54 100644 --- a/python-pyrsistent.spec +++ b/python-pyrsistent.spec @@ -1,92 +1,75 @@ -%define anolis_release 1 - +%define anolis_release 2 %bcond_with doc_pdf +%bcond_without tests +%global pypi_name pyrsistent -Name: python-pyrsistent -Summary: Persistent/Functional/Immutable data structures +Name: python-%{pypi_name} +Summary: Persistent/Immutable/Functional data structures for Python Version: 0.19.3 Release: %{anolis_release}%{dist} - -# The entire source is MIT, except pyrsistent/_toolz.py which is BSD. License: MIT AND BSD-3-Clause -URL: https://github.com/tobgu/pyrsistent/ -Source0: %{url}/archive/v%{version}/pyrsistent-%{version}.tar.gz +URL: https://github.com/tobgu/%{pypi_name}/ +Source0: https://github.com/tobgu/%{pypi_name}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz -BuildRequires: python3-devel -BuildRequires: python3-hypothesis -BuildRequires: python3-pip -BuildRequires: python3-pytest +BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-hypothesis python%{python3_pkgversion}-pip python%{python3_pkgversion}-wheel +BuildRequires: pyproject-rpm-macros BuildRequires: gcc -# For Sphinx documentation %if %{with doc_pdf} -BuildRequires: make -BuildRequires: python3-sphinx-latex -BuildRequires: latexmk +BuildRequires: make python%{python3_pkgversion}-sphinx-latex latexmk %endif -# ============================================================================ -# From setup_requires in setup.py, when tests are to be executed: -BuildRequires: python3dist(pytest-runner) - -# Note that pyrsistent/_toolz.py contains a bit of code ported from toolz, but -# not enough to constitute a bundled dependency. +%if %{with tests} +BuildRequires: python%{python3_pkgversion}-pytest +%endif -%global common_description %{expand: +%description Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are immutable. -All methods on a data structure that would normally mutate it instead -return a new copy of the structure containing the requested updates. The -original structure is left untouched.} +Pyrsistent is influenced by persistent data structures such as those found +in the standard library of Clojure. The data structures are designed to +share common elements through path copying. It aims at taking these concepts +and make them as pythonic as possible so that they can be easily integrated +into any python program without hassle. -%description %{common_description} +%package -n python%{python3_pkgversion}-%{pypi_name} +Summary: Persistent/Immutable/Functional data structures for Python -%package -n python3-pyrsistent -Summary: %{summary} +%description -n python%{python3_pkgversion}-%{pypi_name} +Pyrsistent is a number of persistent collections (by some referred to as +functional data structures). Persistent in the sense that they are +immutable. -%description -n python3-pyrsistent %{common_description} +Pyrsistent is influenced by persistent data structures such as those found +in the standard library of Clojure. The data structures are designed to +share common elements through path copying. It aims at taking these concepts +and make them as pythonic as possible so that they can be easily integrated +into any python program without hassle. %package doc -Summary: Documentation for pyrsistent - +Summary: Documentation files for %{name} BuildArch: noarch -%description doc %{common_description} +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%autosetup -n pyrsistent-%{version} -p1 - -# Loosen exact-version pins in requirements.txt; we must tolerate newer -# versions and use what is packaged. -# -# We do not need: -# - memory-profiler or psutil, since we are not running the memorytest* -# environment from tox.ini -# - pyperform, since we are not running the benchmarks from -# performance_suites/ -# - tox, since we are not using tox to run the tests -# - twine, since it is for maintainer PyPI uploads +%autosetup -n %{pypi_name}-%{version} -p1 sed -r \ -e 's/==/>=/' \ -e '/\b(memory-profiler|psutil|pyperform|tox|twine)\b/d' \ requirements.txt | tee requirements-filtered.txt - %generate_buildrequires -%pyproject_buildrequires -r requirements-filtered.txt - +%pyproject_buildrequires requirements-filtered.txt %build %pyproject_wheel - -# Default SPHINXOPTS are '-W -n', but -W turns warnings into errors and there -# are some warnings. We want to build the documentation as best we can anyway. -# Additionally, we parallelize sphinx-build. %if %{with doc_pdf} PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='-n %{?_smp_mflags}' %make_build -C docs/build/latex LATEXMKOPTS='-quiet' @@ -95,28 +78,31 @@ PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='-n %{?_smp_mflags}' %install %pyproject_install -%pyproject_save_files pyrsistent _pyrsistent_version pvectorc +%pyproject_save_files %{pypi_name} _%{pypi_name}_version pvectorc +%if %{with tests} %check -# # See tox.ini: %pytest -%pytest --doctest-modules pyrsistent +%pytest --doctest-modules %{pypi_name} +%endif -%files -n python3-pyrsistent -f %{pyproject_files} +%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} +%license LICENSE.mit %files doc -%license LICENSE.mit -%doc CHANGES.txt -%doc README.rst +%doc CHANGES.txt README.rst %if %{with doc_pdf} %doc docs/build/latex/Pyrsistent.pdf %endif %changelog +* Sat Apr 08 2023 Shawn Wang - 0.19.3-2 +- Optimize the spec file + * Thu Feb 02 2023 mgb01105731 - 0.19.3-1 - update to version 0.19.3