dda3cef
Name:           python-strictyaml
49088a3
Version:        1.6.2
f51bc56
Release:        %autorelease
82c2df0
Summary:        Parses and validates a restricted subset of YAML
82c2df0
3f44fba
# SPDX
82c2df0
License:        MIT
dda3cef
URL:            http://hitchdev.com/strictyaml
1183d47
%global forgeurl https://github.com/crdoconnor/strictyaml
49088a3
Source0:        %{forgeurl}/archive/%{version}/strictyaml-%{version}.tar.gz
db97c28
# https://github.com/crdoconnor/strictyaml/issues/152
db97c28
Source1:        https://sourceforge.net/p/ruamel-yaml/code/ci/0.16.13/tree/LICENSE?format=raw#/LICENSE-ruamel-yaml
82c2df0
82c2df0
BuildArch:      noarch
82c2df0
82c2df0
BuildRequires:  python3-devel
82c2df0
82c2df0
# We do not attempt to build the documentation, since it requires an
82c2df0
# idiosyncratic build system (see https://hitchdev.com/) that is hopelessly
82c2df0
# entangled with the idea of downloading dependencies from PyPI. An offline
82c2df0
# build would be nearly impossible.
82c2df0
82c2df0
%global common_description %{expand:
82c2df0
StrictYAML is a type-safe YAML parser that parses and validates a restricted
82c2df0
subset of the YAML specification.
82c2df0
82c2df0
Priorities:
82c2df0
82c2df0
  • Beautiful API
82c2df0
  • Refusing to parse the ugly, hard to read and insecure features of YAML like
82c2df0
    the Norway problem.
82c2df0
  • Strict validation of markup and straightforward type casting.
82c2df0
  • Clear, readable exceptions with code snippets and line numbers.
82c2df0
  • Acting as a near-drop in replacement for pyyaml, ruamel.yaml or poyo.
82c2df0
  • Ability to read in YAML, make changes and write it out again with comments
82c2df0
    preserved.
82c2df0
  • Not speed, currently.}
82c2df0
82c2df0
%description %{common_description}
82c2df0
82c2df0
dda3cef
%package -n     python3-strictyaml
82c2df0
Summary:        %{summary}
82c2df0
db97c28
# Upstream bundled/vendored a slightly older version of ruamel.yaml after an
db97c28
# update with API changes was too difficult to support. This is intended to be
db97c28
# a temporary workaround until the vendored library can be replaced with a
db97c28
# custom parser for StrictYAML. See
db97c28
# https://github.com/crdoconnor/strictyaml/issues/151 for discussion, and
db97c28
# strictyaml/ruamel/__init__.py for version information.
db97c28
Provides:       bundled(python3dist(ruamel-yaml)) = 0.16.13
db97c28
dda3cef
%description -n python3-strictyaml %{common_description}
82c2df0
82c2df0
82c2df0
%prep
1183d47
%autosetup -n strictyaml-%{version}
db97c28
cp -p '%{SOURCE1}' .
95b0cbd
# Upstream’s idiosyncratic build system normally handles this:
95b0cbd
sed -r -i 's/(__version__ *= *")DEVELOPMENT_VERSION"/\1%{version}"/' \
95b0cbd
    'strictyaml/__init__.py'
82c2df0
82c2df0
ab92d19
%generate_buildrequires
49088a3
%pyproject_buildrequires
ab92d19
ab92d19
82c2df0
%build
a7e01f7
%pyproject_wheel
82c2df0
82c2df0
82c2df0
%install
a7e01f7
%pyproject_install
dda3cef
%pyproject_save_files strictyaml
82c2df0
82c2df0
212207e
%check
82c2df0
# There are no tests. (If there were, it would be as hard to run them as it is
0939887
# to build the documentation.) We therefore do an import-only “smoke test.” We
0939887
# must skip one module in the bundled ruamel-yaml because it does not include
0939887
# the compiled C extension (_ruamel_yaml).
0939887
%pyproject_check_import -e strictyaml.ruamel.cyaml
82c2df0
82c2df0
dda3cef
%files -n python3-strictyaml -f %{pyproject_files}
82c2df0
%doc CHANGELOG.md
82c2df0
%doc README.md
82c2df0
82c2df0
82c2df0
%changelog
f51bc56
%autochangelog