From 581fd63e02243f0af73d04bf23f665cdfdeeeab0 Mon Sep 17 00:00:00 2001 From: Daniel Uvehag Date: Wed, 20 Apr 2022 12:35:01 +0200 Subject: [PATCH] Initial package --- python-jsonschema.spec | 83 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++ 2 files changed, 87 insertions(+) create mode 100644 python-jsonschema.spec create mode 100644 setup.py diff --git a/python-jsonschema.spec b/python-jsonschema.spec new file mode 100644 index 0000000..1c2f463 --- /dev/null +++ b/python-jsonschema.spec @@ -0,0 +1,83 @@ +%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 - 4.4.0-1 +- Initial package. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5af9ebc --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +from os import environ +from setuptools import setup + +setup(version=environ.get('VERSION', None))