]> git.pld-linux.org Git - packages/python-pytest-mock.git/blob - python-pytest-mock.spec
98c3c2c6e101a0d63b19a7c99e0f0aa2a7bb0150
[packages/python-pytest-mock.git] / python-pytest-mock.spec
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
7 Summary:        Thin-wrapper around the mock package for easier use with py.test
8 Summary(pl.UTF-8):      Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
9 Name:           python-pytest-mock
10 Version:        1.10.0
11 Release:        2
12 License:        MIT
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/pytest-mock/
15 Source0:        https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
16 # Source0-md5:  e6c9eb6213df77cd258222dce3f23877
17 URL:            https://pypi.org/project/pytest-mock/
18 %if %{with python2}
19 BuildRequires:  python-modules >= 1:2.7
20 BuildRequires:  python-setuptools
21 BuildRequires:  python-setuptools_scm
22 %if %{with tests}
23 BuildRequires:  python-mock
24 BuildRequires:  python-pytest >= 2.7
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.4
29 BuildRequires:  python3-setuptools
30 BuildRequires:  python3-setuptools_scm
31 %if %{with tests}
32 BuildRequires:  python3-pytest >= 2.7
33 # there is py3 test which relies on "mock" standalone module not being installed
34 BuildConflicts: python3-mock
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 BuildRequires:  sed >= 4.0
40 Requires:       python-modules >= 1:2.7
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 This plugin installs a mocker fixture which is a thin-wrapper around
46 the patching API provided by the mock package, but with the benefit of
47 not having to worry about undoing patches at the end of a test.
48
49 %description -l pl.UTF-8
50 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
51 cienką warstwą ponad API dostarczane przez pakiet mock, ale
52 pozwalający nie martwić się o wycofywanie łat na końcu testu.
53
54 %package -n python3-pytest-mock
55 Summary:        Thin-wrapper around the mock package for easier use with py.test
56 Summary(pl.UTF-8):      Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
57 Group:          Libraries/Python
58 Requires:       python3-modules >= 1:3.4
59
60 %description -n python3-pytest-mock
61 This plugin installs a mocker fixture which is a thin-wrapper around
62 the patching API provided by the mock package, but with the benefit of
63 not having to worry about undoing patches at the end of a test.
64
65 %description -n python3-pytest-mock -l pl.UTF-8
66 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
67 cienką warstwą ponad API dostarczane przez pakiet mock, ale
68 pozwalają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}
78 PYTHONPATH=$(pwd) %{__python} -m pytest
79 %endif
80 %endif
81
82 %if %{with python3}
83 %py3_build
84
85 %if %{with tests}
86 PYTHONPATH=$(pwd) %{__python3} -m pytest
87 %endif
88 %endif
89
90 %install
91 rm -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)
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
106 %endif
107
108 %clean
109 rm -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.093412 seconds and 2 git commands to generate.