]> git.pld-linux.org Git - packages/python-schema.git/blob - python-schema.spec
0d5c1d9ac0d68b306df68a20190ee590fae6bc7e
[packages/python-schema.git] / python-schema.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 Summary:        Schema validation just got Pythonic
8 Summary(pl.UTF-8):      Pythonowe sprawdzanie zgodności ze schematem
9 Name:           python-schema
10 Version:        0.7.2
11 Release:        3
12 License:        MIT
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/schema/
15 Source0:        https://files.pythonhosted.org/packages/source/s/schema/schema-%{version}.tar.gz
16 # Source0-md5:  e9b98f979dbda29c3f7bc63e09b20878
17 Patch0:         %{name}-requirements.patch
18 URL:            https://pypi.org/project/schema/
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.6
21 BuildRequires:  python-setuptools
22 %if "%{py_ver}" < "2.7"
23 BuildRequires:  python-contextlib2 >= 0.5.5
24 %endif
25 %if %{with tests}
26 BuildRequires:  python-mock
27 BuildRequires:  python-pytest
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-modules >= 1:3.2
32 BuildRequires:  python3-setuptools
33 %if %{with tests}
34 BuildRequires:  python3-pytest
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 Requires:       python-modules >= 1:2.6
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 schema is a library for validating Python data structures, such as
45 those obtained from config-files, forms, external services or
46 command-line parsing, converted from JSON/YAML (or something else) to
47 Python data-types.
48
49 %description -l pl.UTF-8
50 schema to biblioteka do sprawdzania poprawności pythonowych struktur
51 danych, takich jak pochodzące z plików konfiguracyjnych, formularzy,
52 usług zewnętrznych czy analizy wiersza poleceń, przekształcone z
53 JSON-a/YAML-a (lub czegoś innego) do typów pythonowych.
54
55 %package -n python3-schema
56 Summary:        Schema validation just got Pythonic
57 Summary(pl.UTF-8):      Pythonowe sprawdzanie zgodności ze schematem
58 Group:          Libraries/Python
59 Requires:       python3-modules >= 1:3.2
60
61 %description -n python3-schema
62 schema is a library for validating Python data structures, such as
63 those obtained from config-files, forms, external services or
64 command-line parsing, converted from JSON/YAML (or something else) to
65 Python data-types.
66
67 %description -n python3-schema -l pl.UTF-8
68 schema to biblioteka do sprawdzania poprawności pythonowych struktur
69 danych, takich jak pochodzące z plików konfiguracyjnych, formularzy,
70 usług zewnętrznych czy analizy wiersza poleceń, przekształcone z
71 JSON-a/YAML-a (lub czegoś innego) do typów pythonowych.
72
73 %prep
74 %setup -q -n schema-%{version}
75 %patch0 -p1
76
77 %build
78 %if %{with python2}
79 %py_build
80
81 %if %{with tests}
82 %{__python} -m pytest test_schema.py
83 %endif
84 %endif
85
86 %if %{with python3}
87 %py3_build
88
89 %if %{with tests}
90 %{__python3} -m pytest test_schema.py
91 %endif
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 %py_install
99
100 %py_postclean
101 %endif
102
103 %if %{with python3}
104 %py3_install
105 %endif
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %files
112 %defattr(644,root,root,755)
113 %doc LICENSE-MIT README.rst
114 %{py_sitescriptdir}/schema.py[co]
115 %{py_sitescriptdir}/schema-%{version}-py*.egg-info
116 %endif
117
118 %if %{with python3}
119 %files -n python3-schema
120 %defattr(644,root,root,755)
121 %doc LICENSE-MIT README.rst
122 %{py3_sitescriptdir}/schema.py
123 %{py3_sitescriptdir}/__pycache__/schema.cpython-*.py[co]
124 %{py3_sitescriptdir}/schema-%{version}-py*.egg-info
125 %endif
This page took 0.062947 seconds and 2 git commands to generate.