]> git.pld-linux.org Git - packages/python-pytest.git/blob - python-pytest.spec
9a14598e9061b59d6a293ea1a945a5656c8282a2
[packages/python-pytest.git] / python-pytest.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation build
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         pylib_version   1.4.29
8 %define         module  pytest
9 Summary:        Simple and popular testing tool for Python
10 Summary(pl.UTF-8):      Proste i popularne narzędzie testujące dla Pythona
11 Name:           python-%{module}
12 Version:        2.9.2
13 Release:        2
14 License:        MIT
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.python.org/simple/pytest
17 Source0:        https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
18 # Source0-md5:  b65c2944dfaa0efb62c0239afb424f5b
19 URL:            http://pytest.org/
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.6
22 BuildRequires:  python-modules >= 1:2.6
23 BuildRequires:  python-py >= %{pylib_version}
24 BuildRequires:  python-setuptools >= 7.0
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.3
28 BuildRequires:  python3-modules >= 1:3.3
29 BuildRequires:  python3-py >= %{pylib_version}
30 BuildRequires:  python3-setuptools >= 7.0
31 %endif
32 BuildRequires:  rpm-pythonprov
33 BuildRequires:  rpmbuild(macros) >= 1.714
34 BuildRequires:  sed >= 4.0
35 %if %{with doc}
36 BuildRequires:  sphinx-pdg >= 1.0
37 %endif
38 Obsoletes:      python-pytest-cache
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 py.test is a simple and popular testing tool for Python.
44
45 %description -l pl.UTF-8
46 py.test to proste i popularne narzędzie testujące dla Pythona.
47
48 %package -n python3-pytest
49 Summary:        Simple powerful testing with Python
50 Summary(pl.UTF-8):      Proste, ale funkcjonalne narzędzie testujące dla Pythona
51 Group:          Development/Languages
52 Suggests:       python3-setuptools
53 Obsoletes:      python3-pytest-cache
54
55 %description -n python3-pytest
56 py.test provides simple, yet powerful testing for Python.
57
58 %description -n python3-pytest -l pl.UTF-8
59 py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
60 Pythona.
61
62 %package apidocs
63 Summary:        Documentation for py.test Pythona package
64 Summary(pl.UTF-8):      Dokumentacja pakietu Pythona py.test
65 Group:          Documentation
66
67 %description apidocs
68 Documentation for py.test Pythona package.
69
70 %description apidocs -l pl.UTF-8
71 Dokumentacja pakietu Pythona py.test.
72
73 %prep
74 %setup -q -n %{module}-%{version}
75
76 %build
77 %if %{with python2}
78 %py_build
79 %endif
80
81 %if %{with python3}
82 %py3_build
83 %endif
84
85 %if %{with doc}
86 install -d _htmldocs/html
87 for l in doc/*; do
88         PYTHONPATH=$(pwd) \
89         %{__make} -C $l html
90         # remove hidden file
91         %{__rm} $l/_build/html/.buildinfo
92         %{__mv} $l/_build/html _htmldocs/html/${l##doc/}
93 done
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python3}
100 %py3_install
101 %endif
102
103 %if %{with python2}
104 %py_install
105
106 # pytest.py source seems required for "monkeypatching" tests
107 %py_postclean -x pytest.py
108 %endif
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %files
115 %defattr(644,root,root,755)
116 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
117 %attr(755,root,root) %{_bindir}/py.test
118 %attr(755,root,root) %{_bindir}/py.test-%{py_ver}
119 %{py_sitescriptdir}/pytest.py*
120 %{py_sitescriptdir}/_pytest
121 %{py_sitescriptdir}/pytest-%{version}-py*.egg-info
122 %endif
123
124 %if %{with python3}
125 %files -n python3-pytest
126 %defattr(644,root,root,755)
127 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
128 %attr(755,root,root) %{_bindir}/py.test-%{py3_ver}
129 %{py3_sitescriptdir}/pytest.py
130 %{py3_sitescriptdir}/_pytest
131 %{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
132 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
133 %endif
134
135 %if %{with doc}
136 %files apidocs
137 %defattr(644,root,root,755)
138 %doc _htmldocs/html
139 %endif
This page took 0.907533 seconds and 2 git commands to generate.