## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec # Enabled by default %bcond_without tests # 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 Name: python-configupdater Version: 3.0.1 Release: %autorelease Summary: Parser like ConfigParser but for updating configuration files License: MIT URL: https://github.com/pyscaffold/configupdater Source0: %{pypi_source ConfigUpdater} BuildArch: noarch %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx-latex BuildRequires: latexmk %endif %global _description %{expand: The sole purpose of ConfigUpdater is to easily update an INI config file with no changes to the original file except the intended ones. This means comments, the ordering of sections and key/value-pairs as well as their cases are kept as in the original file. Thus ConfigUpdater provides complementary functionality to Python’s ConfigParser which is primarily meant for reading config files and writing new ones. Features: The key differences to ConfigParser are: • minimal invasive changes in the update configuration file, • proper handling of comments, • only a single config file can be updated at a time, • the original case of sections and keys are kept, • control over the position of a new section/key The following features are deliberately not implemented: • interpolation of values, • propagation of parameters from the default section, • conversions of values, • passing key/value-pairs with default argument, • non-strict mode allowing duplicate sections and keys.} %description %_description %package -n python3-ConfigUpdater Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-setuptools_scm BuildRequires: %{py3_dist pytest} %description -n python3-ConfigUpdater %_description %package doc Summary: Documentation for %{name} %description doc This package provides generated documentation for %{name}. %prep %autosetup -n ConfigUpdater-%{version} # Remove coverage bits sed -i -r '/(--cov|pytest-cov)/ d' setup.cfg # Drop intersphinx mappings, since these want to access the network. We could # replace some of these with local mappings and depend on the relevant -doc # subpackages, but given that Sphinx HTML documentation is not suitable for # packaging, we decide it is not worth the bother to link to documentation that # probably should not be packaged anyway. echo 'intersphinx_mapping = {}' >> docs/conf.py %generate_buildrequires %pyproject_buildrequires -r%{?with_tests: -x testing} %build %pyproject_wheel %if %{with doc_pdf} %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files configupdater %check %if %{with tests} %pytest %endif %files -n python3-ConfigUpdater -f %{pyproject_files} %license LICENSE.txt %doc AUTHORS.rst %doc CHANGELOG.rst %doc CONTRIBUTING.rst %doc README.rst %files doc %license LICENSE.txt %if %{with doc_pdf} %doc docs/_build/latex/user_guide.pdf %endif %changelog * Thu Dec 23 2021 Benjamin A. Beasley - 3.0.1-2 - Switch to pyproject-rpm-macros - Build Sphinx documentation as PDF instead of HTML to sidestep bundled web assets * Sat Oct 23 2021 Fedora Release Monitoring - 3.0.1-1 - Update to 3.0.1 (#2016777) * Mon Sep 13 2021 Josh Santos - 3.0-1 - new version * Fri Jul 23 2021 Fedora Release Engineering - 2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Wed Jul 07 2021 Ankur Sinha - 2.0-1 - minor typo fixes - improve doc sub-package summary * Wed Jul 07 2021 Ankur Sinha - 2.0-1 - improve doc package description - add space in package description * Tue Jul 06 2021 Ankur Sinha - 2.0-1 - Initial build