2012-07-26 15:56:42 +02:00
|
|
|
#
|
2024-05-02 09:49:22 +02:00
|
|
|
# spec file for package python-jsonschema
|
2012-07-26 15:56:42 +02:00
|
|
|
#
|
2024-01-17 23:09:08 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2012-07-26 15:56:42 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-01-14 16:25:05 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-11-22 16:43:46 +01:00
|
|
|
#
|
2012-07-26 15:56:42 +02:00
|
|
|
|
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
|
|
|
|
2021-11-06 11:35:34 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2023-04-21 16:37:08 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-12-27 18:41:17 +01:00
|
|
|
Name: python-jsonschema%{psuffix}
|
2024-05-02 09:49:22 +02:00
|
|
|
Version: 4.22.0
|
2012-07-26 15:56:42 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: An implementation of JSON-Schema validation for Python
|
2012-11-22 16:43:46 +01:00
|
|
|
License: MIT
|
2022-04-27 15:48:44 +02:00
|
|
|
URL: https://github.com/python-jsonschema/jsonschema
|
2017-04-20 00:13:38 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/j/jsonschema/jsonschema-%{version}.tar.gz
|
2023-07-06 13:22:17 +02:00
|
|
|
BuildRequires: %{python_module base >= 3.8}
|
2022-10-04 09:40:04 +02:00
|
|
|
BuildRequires: %{python_module hatch-fancy-pypi-readme}
|
2022-07-19 17:23:18 +02:00
|
|
|
BuildRequires: %{python_module hatch_vcs}
|
|
|
|
BuildRequires: %{python_module hatchling}
|
2022-04-27 15:48:44 +02:00
|
|
|
BuildRequires: %{python_module pip}
|
2018-01-24 11:25:06 +01:00
|
|
|
BuildRequires: fdupes
|
2021-11-06 11:35:34 +01:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
2022-12-27 18:41:17 +01:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module jsonschema = %{version}}
|
|
|
|
BuildRequires: %{python_module jsonschema-format = %{version}}
|
|
|
|
BuildRequires: %{python_module jsonschema-format-nongpl = %{version}}
|
2023-07-06 13:22:17 +02:00
|
|
|
BuildRequires: %{python_module jsonschema-specifications}
|
|
|
|
BuildRequires: %{python_module rpds-py}
|
|
|
|
BuildRequires: %{python_module virtue}
|
2022-12-27 18:41:17 +01:00
|
|
|
BuildRequires: git-core
|
|
|
|
%endif
|
2019-09-20 14:03:14 +02:00
|
|
|
Requires: python-attrs >= 17.4.0
|
2023-07-06 13:22:17 +02:00
|
|
|
Requires: python-jsonschema-specifications
|
2019-09-20 14:03:14 +02:00
|
|
|
Requires: python-pyrsistent >= 0.14.0
|
2023-07-06 13:22:17 +02:00
|
|
|
Requires: python-referencing
|
|
|
|
Requires: python-rpds-py
|
2022-04-27 15:48:44 +02:00
|
|
|
%if 0%{python_version_nodots} < 38
|
|
|
|
Requires: python-importlib-metadata
|
|
|
|
Requires: python-typing-extensions
|
|
|
|
%endif
|
|
|
|
%if 0%{python_version_nodots} < 39
|
|
|
|
Requires: python-importlib-resources >= 1.4.0
|
2022-09-26 10:42:20 +02:00
|
|
|
Requires: python-pkgutil-resolve-name >= 1.3.10
|
2022-04-27 15:48:44 +02:00
|
|
|
%endif
|
2021-11-06 11:35:34 +01:00
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
BuildRequires: alts
|
|
|
|
%else
|
2019-04-08 21:16:37 +02:00
|
|
|
Requires(post): update-alternatives
|
2024-05-02 09:49:22 +02:00
|
|
|
Requires(preun): update-alternatives
|
2021-11-06 11:35:34 +01:00
|
|
|
%endif
|
2019-04-08 21:16:37 +02:00
|
|
|
BuildArch: noarch
|
2017-04-19 16:21:41 +02:00
|
|
|
%python_subpackages
|
2012-07-26 15:56:42 +02:00
|
|
|
|
|
|
|
%description
|
2022-10-13 11:00:08 +02:00
|
|
|
jsonschema is an implementation of the JSON Schema specification for Python
|
|
|
|
The validator can be used as python module and from console:
|
|
|
|
|
|
|
|
$ jsonschema --instance sample.json sample.schema
|
2012-07-26 15:56:42 +02:00
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%package format
|
|
|
|
Summary: An implementation of JSON-Schema validation for Python [format] extra
|
|
|
|
Requires: python-fqdn
|
|
|
|
Requires: python-idna
|
|
|
|
Requires: python-isoduration
|
|
|
|
Requires: python-jsonpointer > 1.13
|
|
|
|
Requires: python-jsonschema = %{version}
|
|
|
|
Requires: python-rfc3339-validator
|
|
|
|
Requires: python-rfc3987
|
|
|
|
Requires: python-uri_template
|
|
|
|
Requires: python-webcolors >= 1.11
|
|
|
|
|
|
|
|
%description format
|
|
|
|
jsonschema is an implementation of the JSON Schema specification for Python.
|
|
|
|
|
|
|
|
This subpackage provides the [format] extra
|
|
|
|
|
|
|
|
%package format-nongpl
|
|
|
|
Summary: An implementation of JSON-Schema validation for Python [format-nongpl] extra
|
|
|
|
Requires: python-fqdn
|
|
|
|
Requires: python-idna
|
|
|
|
Requires: python-isoduration
|
|
|
|
Requires: python-jsonpointer > 1.13
|
|
|
|
Requires: python-jsonschema = %{version}
|
|
|
|
Requires: python-rfc3339-validator
|
|
|
|
Requires: python-rfc3986-validator > 0.1.0
|
|
|
|
Requires: python-uri_template
|
|
|
|
Requires: python-webcolors >= 1.11
|
|
|
|
|
|
|
|
%description format-nongpl
|
|
|
|
jsonschema is an implementation of the JSON Schema specification for Python.
|
|
|
|
|
|
|
|
This subpackage provides the [format-nongpl] extra
|
|
|
|
|
2012-07-26 15:56:42 +02:00
|
|
|
%prep
|
|
|
|
%setup -q -n jsonschema-%{version}
|
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%if !%{with test}
|
2012-07-26 15:56:42 +02:00
|
|
|
%build
|
2022-04-27 15:48:44 +02:00
|
|
|
%pyproject_wheel
|
2012-07-26 15:56:42 +02:00
|
|
|
|
|
|
|
%install
|
2022-04-27 15:48:44 +02:00
|
|
|
%pyproject_install
|
2019-09-20 14:03:14 +02:00
|
|
|
# Remove benchmark tests
|
|
|
|
%{python_expand rm -r %{buildroot}%{$python_sitelib}/jsonschema/benchmarks %{buildroot}%{$python_sitelib}/jsonschema/tests
|
2019-10-14 15:50:18 +02:00
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
2019-09-20 14:03:14 +02:00
|
|
|
}
|
2019-04-08 21:16:37 +02:00
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
# Prepare for libalternatives/update-alternatives usage
|
2017-04-19 16:21:41 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/jsonschema
|
2022-12-27 18:41:17 +01:00
|
|
|
%endif
|
2012-07-26 15:56:42 +02:00
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%if %{with test}
|
2012-07-26 15:56:42 +02:00
|
|
|
%check
|
2022-09-26 10:42:20 +02:00
|
|
|
export JSON_SCHEMA_TEST_SUITE=$PWD/json
|
|
|
|
%{python_expand # see tox.ini
|
|
|
|
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
2023-07-06 13:22:17 +02:00
|
|
|
$python -B -m virtue jsonschema
|
2022-09-26 10:42:20 +02:00
|
|
|
}
|
2022-12-27 18:41:17 +01:00
|
|
|
%endif
|
2012-07-26 15:56:42 +02:00
|
|
|
|
2021-11-06 11:35:34 +01:00
|
|
|
%pre
|
|
|
|
# If libalternatives is used: Removing old update-alternatives entries.
|
|
|
|
%python_libalternatives_reset_alternative jsonschema
|
|
|
|
|
2014-09-15 16:01:21 +02:00
|
|
|
%post
|
2017-04-19 16:21:41 +02:00
|
|
|
%python_install_alternative jsonschema
|
2014-09-15 16:01:21 +02:00
|
|
|
|
|
|
|
%preun
|
2017-04-19 16:21:41 +02:00
|
|
|
%python_uninstall_alternative jsonschema
|
2014-09-15 16:01:21 +02:00
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%if !%{with test}
|
2017-04-19 16:21:41 +02:00
|
|
|
%files %{python_files}
|
2019-01-14 16:25:05 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc README.rst
|
2017-04-19 16:21:41 +02:00
|
|
|
%python_alternative %{_bindir}/jsonschema
|
2021-01-15 14:39:42 +01:00
|
|
|
%{python_sitelib}/jsonschema
|
|
|
|
%{python_sitelib}/jsonschema-%{version}*-info
|
2012-07-26 15:56:42 +02:00
|
|
|
|
2022-12-27 18:41:17 +01:00
|
|
|
%files %{python_files format}
|
|
|
|
%license COPYING
|
|
|
|
|
|
|
|
%files %{python_files format-nongpl}
|
|
|
|
%license COPYING
|
|
|
|
%endif
|
|
|
|
|
2012-07-26 15:56:42 +02:00
|
|
|
%changelog
|