## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 9;
    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

Name:           python-strictyaml
Version:        1.7.3
Release:        %autorelease
Summary:        Parses and validates a restricted subset of YAML

# SPDX
License:        MIT
URL:            http://hitchdev.com/strictyaml
%global forgeurl https://github.com/crdoconnor/strictyaml
Source0:        %{forgeurl}/archive/%{version}/strictyaml-%{version}.tar.gz
# https://github.com/crdoconnor/strictyaml/issues/152
Source1:        https://sourceforge.net/p/ruamel-yaml/code/ci/0.16.13/tree/LICENSE?format=raw#/LICENSE-ruamel-yaml

BuildArch:      noarch

BuildRequires:  python3-devel

# We do not attempt to build the documentation, since it requires an
# idiosyncratic build system (see https://hitchdev.com/) that is hopelessly
# entangled with the idea of downloading dependencies from PyPI. An offline
# build would be nearly impossible.

%global common_description %{expand:
StrictYAML is a type-safe YAML parser that parses and validates a restricted
subset of the YAML specification.

Priorities:

  • Beautiful API
  • Refusing to parse the ugly, hard to read and insecure features of YAML like
    the Norway problem.
  • Strict validation of markup and straightforward type casting.
  • Clear, readable exceptions with code snippets and line numbers.
  • Acting as a near-drop in replacement for pyyaml, ruamel.yaml or poyo.
  • Ability to read in YAML, make changes and write it out again with comments
    preserved.
  • Not speed, currently.}

%description %{common_description}


%package -n     python3-strictyaml
Summary:        %{summary}

# Upstream bundled/vendored a slightly older version of ruamel.yaml after an
# update with API changes was too difficult to support. This is intended to be
# a temporary workaround until the vendored library can be replaced with a
# custom parser for StrictYAML. See
# https://github.com/crdoconnor/strictyaml/issues/151 for discussion, and
# strictyaml/ruamel/__init__.py for version information.
Provides:       bundled(python3dist(ruamel-yaml)) = 0.16.13

%description -n python3-strictyaml %{common_description}


%prep
%autosetup -n strictyaml-%{version}
cp -p '%{SOURCE1}' .
# Upstream’s idiosyncratic build system normally handles this:
sed -r -i 's/(__version__ *= *")DEVELOPMENT_VERSION"/\1%{version}"/' \
    'strictyaml/__init__.py'


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l strictyaml


%check
# There are no tests. (If there were, it would be as hard to run them as it is
# to build the documentation.) We therefore do an import-only “smoke test.” We
# must skip one module in the bundled ruamel-yaml because it does not include
# the compiled C extension (_ruamel_yaml).
%pyproject_check_import -e strictyaml.ruamel.cyaml


%files -n python3-strictyaml -f %{pyproject_files}
%doc CHANGELOG.md
%doc README.md


%changelog
## START: Generated by rpmautospec
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1.7.3-8
- Rebuilt for Python 3.13

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Tue Dec 19 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.7.3-4
- Assert that %%pyproject_files contains a license file

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 1.7.3-2
- Rebuilt for Python 3.12

* Fri Mar 10 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.7.3-1
- Update to 1.7.3 (close RHBZ#2174372)

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sat Oct 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.2-1
- Update to 1.6.2 (close RHBZ#2133184)

* Sat Oct 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.1-7
- Confirm License is SPDX MIT

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.6.1-5
- Rebuilt for Python 3.11

* Wed Apr 20 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.1-4
- Drop License files redundant with pyproject_files

* Wed Apr 20 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.1-3
- Drop “forge” macros, which are doing little for us

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sun Nov 28 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.1-1
- Update to 1.6.1 (close RHBZ#2027119)

* Sat Nov 20 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.6.0-1
- Update to 1.6.0 (fix RHBZ#2025203)

* Fri Oct 29 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-3
- Use the new %%%%pyproject_check_import macro

* Fri Oct 15 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-2
- Fix strictyaml.__version__

* Fri Oct 15 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-1
- Update to 1.5.0

* Mon Sep 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.4-6
- Drop BR on pyproject-rpm-macros, now implied by python3-devel

* Mon Sep 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.4-5
- Reduce macro indirection in the spec file

* Tue Jul 27 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.4-4
- Move %%generate_buildrequires after %%prep to make the spec file easier
  to follow

* Wed Jul 21 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.4-3
- Add import “smoke test”

* Sun Jun 20 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.4-1
- Update to 1.4.4 (closes RHBZ#1974003)
- The package now bundles ruamel.yaml 0.16.13 until the author can supply a
  custom parser to replace it.

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.4.0-2
- Rebuilt for Python 3.10

* Mon Mar 29 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.0-1
- Update to 1.4.0
- Start using pyproject-rpm-macros

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Jan 19 14:10:19 EST 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.2-1
- Update to 1.3.2

* Tue Jan 12 11:40:57 EST 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.1-1
- Update to 1.3.1

* Sun Jan 10 13:51:32 EST 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.0-1
- Update to 1.3.0

* Sat Jan  2 16:01:07 EST 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.2.0-1
- Update to version 1.2.0

* Thu Nov 26 2020 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-3
- Remove conditionals for Fedora 32 and older

* Thu Nov 26 2020 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-2
- Remove EPEL conditionals from Fedora spec file

* Tue Nov 24 2020 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-1
- Initial package

## END: Generated by rpmautospec