## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond_without doc_pdf # Currently, the version of python-cbor2 in Rawhide is too old; at least 5.4.6 # is required. See: https://bugzilla.redhat.com/show_bug.cgi?id=2245361 %bcond cbor2 0 # Currently, the version of python-pymongo in Rawhide is too old; at least # 4.4.0 is required. See: https://bugzilla.redhat.com/show_bug.cgi?id=1823014 %bcond bson 0 Name: python-cattrs Version: 23.2.3 Release: %autorelease Summary: Python library for structuring and unstructuring data # SPDX License: MIT URL: https://github.com/python-attrs/cattrs BuildArch: noarch # The GitHub archive contains tests and docs, which the PyPI sdist lacks Source: %{url}/archive/v%{version}/cattrs-%{version}.tar.gz BuildRequires: python3-devel # There is no obvious, straightforward way to generate dependencies from # [tool.pdm.dev-dependencies] in pyproject.toml, so we maintain them here # manually. # test = [ # "hypothesis>=6.79.4", BuildRequires: %{py3_dist hypothesis} >= 6.79.4 # "pytest>=7.4.0", BuildRequires: %{py3_dist pytest} >= 7.4 # "pytest-benchmark>=4.0.0", # We choose not to run benchmarks with the tests. # BuildRequires: %%{py3_dist pytest-benchmark} >= 4.0.0 # "immutables>=0.20", BuildRequires: %{py3_dist immutables} >= 0.20 # "typing-extensions>=4.7.1", BuildRequires: %{py3_dist typing-extensions} >= 4.7.1 # "coverage>=7.2.7", # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters # BuildRequires: %%{py3_dist coverage} >= 7.2.7 #] # Added to the test dev-dependencies upstream after the packaged release, but # still useful to run the tests in parallel # "pytest-xdist>=3.4.0", BuildRequires: %{py3_dist pytest-xdist} >= 3.4 %if %{with doc_pdf} # docs = [ # "sphinx>=5.3.0", BuildRequires: %{py3_dist sphinx} >= 5.3 # "furo>=2023.3.27", BuildRequires: %{py3_dist furo} >= 2023.3.27 # "sphinx-copybutton>=0.5.2", # Loosened until https://bugzilla.redhat.com/show_bug.cgi?id=2186733 is fixed. BuildRequires: %{py3_dist sphinx-copybutton} >= 0.5.1 # "myst-parser>=1.0.0", BuildRequires: %{py3_dist myst-parser} >= 1 # "pendulum>=2.1.2", BuildRequires: %{py3_dist pendulum} >= 2.1.2 # "sphinx-autobuild", BuildRequires: %{py3_dist sphinx-autobuild} # "typing-extensions>=4.8.0", BuildRequires: %{py3_dist typing-extensions} >= 4.8 # ] BuildRequires: make BuildRequires: python3-sphinx-latex BuildRequires: latexmk %endif %global _description %{expand: cattrs is an open source Python library for structuring and unstructuring data. cattrs works best with attrs classes and the usual Python collections, but other kinds of classes are supported by manually registering converters.} %description %_description %package -n python3-cattrs Summary: %{summary} Obsoletes: python3-cattrs+bson < 23.2.3-1 %description -n python3-cattrs %_description %package doc Summary: Documentation for python-cattrs %description doc %{_description} %pyproject_extras_subpkg -n python3-cattrs ujson orjson msgpack pyyaml tomlkit %{?with_cbor2:cbor2} %{?with_bson:bson} %prep %autosetup -n cattrs-%{version} sed -r -i 's/"(coverage)\b/# &/' pyproject.toml # Don’t run benchmarks when testing, either sed -r -i 's/"(pytest-benchmark)\b/# &/' pyproject.toml sed -r -i 's/ --benchmark[^[:blank:]"]*//g' pyproject.toml # The version-finding code in docs/conf.py relies on a real installed # “distribution” with metadata, which we don’t have at the time the # documentation is built. sed -r -i 's/^(version = ).*/\1 "%{version}"/' docs/conf.py %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_buildrequires -x ujson,orjson,msgpack,pyyaml,tomlkit%{?with_cbor2:,cbor2}%{?with_bson:,bson} %build export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_wheel %if %{with doc_pdf} PYTHONPATH="${PWD}/src" %make_build -C docs latex \ SPHINXBUILD=sphinx-build \ SPHINXOPTS='-j%{?_smp_build_ncpus}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files -l cattrs cattr %check %if %{without cbor2} ignore="${ignore-} --ignore=tests/test_preconf.py" %endif %pytest --ignore-glob='bench/*' ${ignore-} -k "${k-}" -n auto %files -n python3-cattrs -f %{pyproject_files} %files doc %license LICENSE %doc HISTORY.md %doc README.md %if %{with doc_pdf} %doc docs/_build/latex/cattrs.pdf %endif %changelog * Tue Jan 02 2024 Benjamin A. Beasley - 23.2.3-2 - Assert that the .dist-info directory contains a license file - Do not package a duplicate license file * Tue Dec 12 2023 Benjamin A. Beasley - 23.2.3-1 - Update to 23.2.3 (close RHBZ#2252344, fix RHBZ#2237277) - Drop “bson” extra because python-pymongo is too old * Tue Dec 12 2023 Benjamin A. Beasley - 23.1.2-2 - Confirm License is SPDX MIT * Mon Aug 28 2023 Benjamin A. Beasley - 23.1.2-1 - Update to 23.1.2 (close RHBZ#2211212) * Fri Jul 21 2023 Fedora Release Engineering - 22.2.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Apr 13 2023 Benjamin A. Beasley - 22.2.0-13 - Depend on python-orjson now that it is available * Sat Mar 18 2023 Benjamin A. Beasley - 22.2.0-12 - Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus * Wed Mar 01 2023 Miro Hrončok - 22.2.0-11 - Explicitly BuildRequire setuptools to build the documentation * Thu Jan 26 2023 Benjamin A. Beasley - 22.2.0-10 - Build and package Sphinx documentation * Thu Jan 26 2023 Benjamin A. Beasley - 22.2.0-9 - Run the tests * Fri Jan 20 2023 Fedora Release Engineering - 22.2.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-7 - chore: check in sources * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-6 - feat: remove more more unneeded BRs * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-5 - feat: remove unneeded BRs * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-4 - chore: remove macro for consistency * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-3 - fix: explicitly mention license file * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-2 - feat: loosed poetry call * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-1 - feat: ready for re-review * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.1.0-1 - wip: requires orjson, which requires maturin * Mon Aug 19 2019 Miro Hrončok - 0.9.0-5 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 0.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek - 0.9.0-2 - Subpackage python2-cattrs has been removed See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal * Thu Sep 13 2018 Miro Hrončok - 0.9.0-1 - Update to 0.9.0 to fix Python 3.7 FTBFS (#1605625) * Fri Jul 13 2018 Fedora Release Engineering - 0.6.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Jun 19 2018 Miro Hrončok - 0.6.0-4 - Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 0.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Mon Jan 29 2018 Eric Smith 0.6.0-2 - Added missing BuildRequires for python2-enum34. * Thu Jan 11 2018 Eric Smith 0.6.0-1 - Initial version.