Files
rpm-python-jsonschema/python-jsonschema.spec
2022-04-20 12:49:00 +02:00

84 lines
2.3 KiB
RPMSpec

%global pypi_name jsonschema
%global pypi_version 4.4.0
%bcond_without tests
Name: python-%{pypi_name}
Version: %{pypi_version}
Release: 1%{?dist}
Summary: Implementation of JSON Schema validation for Python
License: MIT
URL: https://www.attrs.org/
Source0: %{pypi_source}
Source1: setup.py
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_version}dist(setuptools)
BuildRequires: python%{python3_version}dist(attrs) >= 17.4
%if 0%{?python3_version_nodots} < 38
BuildRequires: python%{python3_version}dist(importlib-metadata)
%endif
%if 0%{?python3_version_nodots} < 39
BuildRequires: python%{python3_version}dist(importlib-resources) >= 1.4.0
%endif
BuildRequires: python%{python3_version}dist(pyrsistent) >= 0.14.0
%global _description %{expand:
jsonschema is an implementation of JSON Schema for Python (supporting
2.7+, including Python 3).
- Full support for Draft 7, Draft 6, Draft 4 and Draft 3
- Lazy validation that can iteratively report all validation errors.
- Small and extensible
- Programmatic querying of which properties or items failed validation.}
%description %_description
%package -n python%{python3_pkgversion}-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
Requires: python%{python3_version}dist(attrs) >= 17.4
%if 0%{?python3_version_nodots} < 38
Requires: python%{python3_version}dist(importlib-metadata)
%endif
%if 0%{?python3_version_nodots} < 39
Requires: python%{python3_version}dist(importlib-resources) >= 1.4.0
%endif
Requires: python%{python3_version}dist(pyrsistent) >= 0.14.0
%description -n python%{python3_pkgversion}-%{pypi_name} %_description
%prep
%autosetup -n %{pypi_name}-%{pypi_version}
cp -v %{SOURCE1} .
rm -rf %{pypi_name}.egg-info
%build
%py3_build
%install
export VERSION=%{version}
%py3_install
%check
%if %{with tests}
PYTHONPATH=$(pwd) trial-3 %{pypi_name}
%endif
%files -n python%{python3_pkgversion}-%{pypi_name}
%license COPYING
%doc README.rst
%{_bindir}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info
%changelog
* Wed Apr 20 2022 Daniel Uvehag <ufven+pkgs@protonmail.com> - 4.4.0-1
- Initial package.