]> git.pld-linux.org Git - SPECS.git/blob - python-testfixtures.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / python-testfixtures.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 Summary:        Collection of helpers and mock objects for unit tests and doc tests
9 Summary(pl.UTF-8):      Zbiór funkcji pomocniczych i obiektów atrap do testów jednostkowych i dokumentacji
10 Name:           python-testfixtures
11 # keep 6.x here for python2 support
12 Version:        6.18.5
13 Release:        1
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/testfixtures/
17 Source0:        https://files.pythonhosted.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz
18 # Source0-md5:  e89cfe8325778a8c519a6bf63ae3fe83
19 URL:            https://pypi.org/project/testfixtures/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-django < 2
25 BuildRequires:  python-mock
26 BuildRequires:  python-pytest >= 3.6
27 BuildRequires:  python-pytest-cov
28 BuildRequires:  python-pytest-django
29 BuildRequires:  python-sybil
30 BuildRequires:  python-twisted
31 BuildRequires:  python-zope.component
32 BuildRequires:  python-zope.interface
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules >= 1:3.6
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
39 BuildRequires:  python3-django
40 BuildRequires:  python3-pytest >= 3.6
41 BuildRequires:  python3-pytest-cov
42 BuildRequires:  python3-pytest-django
43 BuildRequires:  python3-sybil
44 BuildRequires:  python3-twisted
45 BuildRequires:  python3-zope.component
46 BuildRequires:  python3-zope.interface
47 %endif
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 %if %{with doc}
52 BuildRequires:  sphinx-pdg
53 %endif
54 Requires:       python-modules >= 1:2.7
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %description
59 testfixtures is a collection of helpers and mock objects that are
60 useful when writing automated tests in Python.
61
62 %description -l pl.UTF-8
63 testfixtures to zbiór funkcji pomocniczych i obiektów atrap,
64 przydatnych przy pisaniu automatycznych testów w Pythonie.
65
66 %package -n python3-testfixtures
67 Summary:        Collection of helpers and mock objects for unit tests and doc tests
68 Summary(pl.UTF-8):      Zbiór funkcji pomocniczych i obiektów atrap do testów jednostkowych i dokumentacji
69 Group:          Libraries/Python
70 Requires:       python3-modules >= 1:3.6
71
72 %description -n python3-testfixtures
73 testfixtures is a collection of helpers and mock objects that are
74 useful when writing automated tests in Python.
75
76 %description -n python3-testfixtures -l pl.UTF-8
77 testfixtures to zbiór funkcji pomocniczych i obiektów atrap,
78 przydatnych przy pisaniu automatycznych testów w Pythonie.
79
80 %package apidocs
81 Summary:        API documentation for Python testfixtures module
82 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona testfixtures
83 Group:          Documentation
84
85 %description apidocs
86 API documentation for Python testfixtures module.
87
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API modułu Pythona testfixtures.
90
91 %prep
92 %setup -q -n testfixtures-%{version}
93
94 %build
95 %if %{with python2}
96 %py_build
97
98 %if %{with tests}
99 # django test fails with "no such table"
100 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
101 PYTEST_PLUGINS=pytest_django.plugin \
102 %{__python} -m pytest testfixtures/tests -k 'not test_django'
103 %endif
104 %endif
105
106 %if %{with python3}
107 %py3_build
108
109 %if %{with tests}
110 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
111 PYTEST_PLUGINS=pytest_django.plugin \
112 %{__python3} -m pytest testfixtures/tests
113 %endif
114 %endif
115
116 %if %{with doc}
117 PYTHONPATH=$(pwd) \
118 %{__make} -C docs html
119 %endif
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{with python2}
125 %py_install
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %py3_install
132 %endif
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %files
139 %defattr(644,root,root,755)
140 %doc CHANGELOG.rst LICENSE.txt README.rst
141 %{py_sitescriptdir}/testfixtures
142 %{py_sitescriptdir}/testfixtures-%{version}-py*.egg-info
143 %endif
144
145 %if %{with python3}
146 %files -n python3-testfixtures
147 %defattr(644,root,root,755)
148 %doc CHANGELOG.rst LICENSE.txt README.rst
149 %{py3_sitescriptdir}/testfixtures
150 %{py3_sitescriptdir}/testfixtures-%{version}-py*.egg-info
151 %endif
152
153 %if %{with doc}
154 %files apidocs
155 %defattr(644,root,root,755)
156 %doc docs/_build/html/{_static,*.html,*.js}
157 %endif
This page took 0.280088 seconds and 3 git commands to generate.