]> git.pld-linux.org Git - packages/python-jsonschema.git/blob - python-jsonschema.spec
rebuild with python 3.10
[packages/python-jsonschema.git] / python-jsonschema.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  jsonschema
9 Summary:        An implementation of JSON Schema validation for Python 2
10 Summary(pl.UTF-8):      Implementacja sprawdzania poprawności schematu JSON dla Pythona 2
11 Name:           python-%{module}
12 Version:        3.2.0
13 Release:        4
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/jsonschema/
17 Source0:        https://files.pythonhosted.org/packages/source/j/jsonschema/%{module}-%{version}.tar.gz
18 # Source0-md5:  f1a0b5011f05a02a8dee1070cd10a26d
19 # https://json-schema.org/draft-07/json-schema-validation.html (differrent email hashes generated on each download)
20 Source1:        json-schema-validation.html
21 # Source1-md5:  e920693b4c00338d439f0a2240218bcf
22 Patch0:         %{name}-webcolors.patch
23 Patch1:         %{name}-nonet.patch
24 URL:            https://pypi.python.org/pypi/jsonschema
25 %if %{with python2}
26 BuildRequires:  python-functools32
27 BuildRequires:  python-modules >= 1:2.7
28 BuildRequires:  python-setuptools
29 BuildRequires:  python-setuptools_scm
30 BuildRequires:  python-vcversioner >= 2.16.0.0
31 %if %{with tests}
32 BuildRequires:  python-attrs >= 17.4.0
33 BuildRequires:  python-idna
34 BuildRequires:  python-importlib_metadata
35 BuildRequires:  python-jsonpointer >= 1.14
36 BuildRequires:  python-pyrsistent >= 0.14.0
37 BuildRequires:  python-rfc3987
38 BuildRequires:  python-six >= 1.11.0
39 BuildRequires:  python-strict_rfc3339
40 BuildRequires:  python-twisted
41 BuildRequires:  python-webcolors
42 %endif
43 %endif
44 %if %{with python3}
45 BuildRequires:  python3-modules >= 1:3.5
46 BuildRequires:  python3-setuptools
47 BuildRequires:  python3-setuptools_scm
48 BuildRequires:  python3-vcversioner >= 2.16.0.0
49 %if %{with tests}
50 BuildRequires:  python3-attrs >= 17.4.0
51 BuildRequires:  python3-idna
52 %if "%{py3_ver}" < "3.8"
53 BuildRequires:  python-importlib_metadata
54 %endif
55 BuildRequires:  python3-jsonpointer >= 1.14
56 BuildRequires:  python3-pyrsistent >= 0.14.0
57 BuildRequires:  python3-rfc3987
58 BuildRequires:  python3-six >= 1.11.0
59 # optional, but tests fail if python3-isodate is installed and strict_rfc3339 isn't
60 BuildRequires:  python3-strict_rfc3339
61 BuildRequires:  python3-twisted
62 BuildRequires:  python3-webcolors
63 %endif
64 %endif
65 BuildRequires:  rpm-pythonprov
66 BuildRequires:  rpmbuild(macros) >= 1.714
67 %if %{with doc}
68 BuildRequires:  sphinx-pdg-3
69 BuildRequires:  python3-certifi
70 BuildRequires:  python3-lxml
71 BuildRequires:  python3-pyrsistent
72 BuildRequires:  python3-sphinxcontrib-spelling
73 %endif
74 Requires:       python-modules >= 1:2.7
75 BuildArch:      noarch
76 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77
78 %description
79 jsonschema is an implementation of JSON Schema
80 (<https://json-schema.org/>) for Python.
81
82 %description -l pl.UTF-8
83 jsonschema to implementacja JSON Schema (<https://json-schema.org/>)
84 dla Pythona.
85
86 %package -n python3-%{module}
87 Summary:        An implementation of JSON Schema validation for Python 3
88 Summary(pl.UTF-8):      Implementacja sprawdzania poprawności schematu JSON dla Pythona 3
89 Group:          Libraries/Python
90 Requires:       python3-modules >= 1:3.5
91
92 %description -n python3-%{module}
93 jsonschema is an implementation of JSON Schema
94 (<https://json-schema.org/>) for Python.
95
96 %description -n python3-%{module} -l pl.UTF-8
97 jsonschema to implementacja JSON Schema (<https://json-schema.org/>)
98 dla Pythona.
99
100 %prep
101 %setup -q -n %{module}-%{version}
102 %patch0 -p1
103 %patch1 -p1
104
105 install -d docs/_cache
106 cp -p %{SOURCE1} docs/_cache/spec.html
107
108 %build
109 %if %{with python2}
110 %py_build
111
112 %if %{with tests}
113 PYTHONPATH=$(pwd) \
114 trial-2 jsonschema
115 %endif
116 %endif
117
118 %if %{with python3}
119 %py3_build
120
121 %if %{with tests}
122 PYTHONPATH=$(pwd) \
123 trial-3 jsonschema
124 %endif
125 %endif
126
127 %if %{with doc}
128 PYTHONPATH=$(pwd) \
129 %{__make} -C docs html \
130         PYTHON="%{__python3}"
131 %endif
132
133 %install
134 rm -rf $RPM_BUILD_ROOT
135
136 %if %{with python2}
137 %py_install
138
139 %py_postclean
140
141 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-2}
142 %endif
143
144 %if %{with python3}
145 %py3_install
146
147 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-3}
148 ln -sf jsonschema-3 $RPM_BUILD_ROOT%{_bindir}/jsonschema
149 %endif
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %if %{with python2}
155 %files
156 %defattr(644,root,root,755)
157 %doc CHANGELOG.rst COPYING README.rst
158 %attr(755,root,root) %{_bindir}/jsonschema-2
159 %{py_sitescriptdir}/jsonschema
160 %{py_sitescriptdir}/jsonschema-%{version}-py*.egg-info
161 %endif
162
163 %if %{with python3}
164 %files -n python3-%{module}
165 %defattr(644,root,root,755)
166 %doc CHANGELOG.rst COPYING README.rst
167 %attr(755,root,root) %{_bindir}/jsonschema
168 %attr(755,root,root) %{_bindir}/jsonschema-3
169 %{py3_sitescriptdir}/jsonschema
170 %{py3_sitescriptdir}/jsonschema-%{version}-py*.egg-info
171 %endif
This page took 0.049712 seconds and 3 git commands to generate.