]> git.pld-linux.org Git - packages/python-pytest-mock.git/blame - python-pytest-mock.spec
- up to 1.10.3
[packages/python-pytest-mock.git] / python-pytest-mock.spec
CommitLineData
415cc0de
JB
1#
2# Conditional build:
3%bcond_without tests # py.test tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7Summary: Thin-wrapper around the mock package for easier use with py.test
8Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
9Name: python-pytest-mock
38886a87
JR
10Version: 1.10.3
11Release: 1
415cc0de
JB
12License: MIT
13Group: Libraries/Python
4d79a0fe 14#Source0Download: https://pypi.org/simple/pytest-mock/
415cc0de 15Source0: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
38886a87 16# Source0-md5: 54fb753faae3ad740ccd06c2d395045e
4d79a0fe 17URL: https://pypi.org/project/pytest-mock/
415cc0de 18%if %{with python2}
4d79a0fe 19BuildRequires: python-modules >= 1:2.7
415cc0de
JB
20BuildRequires: python-setuptools
21BuildRequires: python-setuptools_scm
22%if %{with tests}
23BuildRequires: python-mock
24BuildRequires: python-pytest >= 2.7
25%endif
26%endif
27%if %{with python3}
4d79a0fe 28BuildRequires: python3-modules >= 1:3.4
415cc0de
JB
29BuildRequires: python3-setuptools
30BuildRequires: python3-setuptools_scm
31%if %{with tests}
32BuildRequires: python3-pytest >= 2.7
c8cd02d3
JB
33# there is py3 test which relies on "mock" standalone module not being installed
34BuildConflicts: python3-mock
415cc0de
JB
35%endif
36%endif
37BuildRequires: rpm-pythonprov
38BuildRequires: rpmbuild(macros) >= 1.714
4d79a0fe
JB
39BuildRequires: sed >= 4.0
40Requires: python-modules >= 1:2.7
415cc0de
JB
41BuildArch: noarch
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45This plugin installs a mocker fixture which is a thin-wrapper around
46the patching API provided by the mock package, but with the benefit of
47not having to worry about undoing patches at the end of a test.
48
49%description -l pl.UTF-8
50Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
51cienką warstwą ponad API dostarczane przez pakiet mock, ale
52pozwalający nie martwić się o wycofywanie łat na końcu testu.
53
54%package -n python3-pytest-mock
55Summary: Thin-wrapper around the mock package for easier use with py.test
56Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
57Group: Libraries/Python
4d79a0fe 58Requires: python3-modules >= 1:3.4
415cc0de
JB
59
60%description -n python3-pytest-mock
61This plugin installs a mocker fixture which is a thin-wrapper around
62the patching API provided by the mock package, but with the benefit of
63not having to worry about undoing patches at the end of a test.
64
65%description -n python3-pytest-mock -l pl.UTF-8
66Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
67cienką warstwą ponad API dostarczane przez pakiet mock, ale
68pozwalający nie martwić się o wycofywanie łat na końcu testu.
69
70%prep
71%setup -q -n pytest-mock-%{version}
72
73%build
74%if %{with python2}
75%py_build
76
77%if %{with tests}
78PYTHONPATH=$(pwd) %{__python} -m pytest
79%endif
80%endif
81
82%if %{with python3}
83%py3_build
84
85%if %{with tests}
86PYTHONPATH=$(pwd) %{__python3} -m pytest
87%endif
88%endif
89
90%install
91rm -rf $RPM_BUILD_ROOT
92
93%if %{with python2}
94%py_install
95
96%py_postclean
97%endif
98
99%if %{with python3}
100%py3_install
101
102# avoid python3egg(mock) dependency (mock required only for python 2.x)
803d92d1
JB
103# (two different notations depending on setuptools version)
104%{__sed} -i -e '/\[:python_version *< *"3.*\]/,/^mock$/d' \
105 -e '/^mock;python_version<"3\.0"/d' $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info/requires.txt
415cc0de
JB
106%endif
107
108%clean
109rm -rf $RPM_BUILD_ROOT
110
111%if %{with python2}
112%files
113%defattr(644,root,root,755)
114%doc CHANGELOG.rst LICENSE README.rst
115%{py_sitescriptdir}/pytest_mock.py[co]
116%{py_sitescriptdir}/_pytest_mock_version.py[co]
117%{py_sitescriptdir}/pytest_mock-%{version}-py*.egg-info
118%endif
119
120%if %{with python3}
121%files -n python3-pytest-mock
122%defattr(644,root,root,755)
123%doc CHANGELOG.rst LICENSE README.rst
124%{py3_sitescriptdir}/pytest_mock.py
125%{py3_sitescriptdir}/_pytest_mock_version.py
126%{py3_sitescriptdir}/__pycache__/pytest_mock.cpython-*.py[co]
127%{py3_sitescriptdir}/__pycache__/_pytest_mock_version.cpython-*.py[co]
128%{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info
129%endif
This page took 0.119124 seconds and 4 git commands to generate.