]>
Commit | Line | Data |
---|---|---|
792227e6 JB |
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: Fake file system that mocks the Python 2 file system modules | |
9 | Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 2 dla plików | |
10 | Name: python-pyfakefs | |
937394ee JB |
11 | Version: 3.7.2 |
12 | Release: 1 | |
792227e6 JB |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://github.com/jmcgeheeiv/pyfakefs/releases | |
16 | Source0: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}/pyfakefs-%{version}.tar.gz | |
937394ee | 17 | # Source0-md5: e34234db867202b035d48a77d1c78d82 |
792227e6 JB |
18 | URL: http://pyfakefs.org/ |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %{?with_doc:BuildRequires: sphinx-pdg >= 1.0} | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
792227e6 | 24 | BuildRequires: python-setuptools |
937394ee JB |
25 | %if %{with tests} |
26 | BuildRequires: python-pathlib2 >= 2.3.2 | |
27 | BuildRequires: python-pytest >= 2.8.6 | |
28 | BuildRequires: python-scandir >= 1.8 | |
29 | %endif | |
792227e6 JB |
30 | %endif |
31 | %if %{with python3} | |
937394ee | 32 | BuildRequires: python3-modules >= 1:3.4 |
792227e6 | 33 | BuildRequires: python3-setuptools |
937394ee JB |
34 | %if %{with tests} |
35 | BuildRequires: python3-pytest >= 2.8.6 | |
36 | %if "%{py3_ver}" < "3.6" | |
37 | BuildRequires: python3-pathlib2 >= 2.3.2 | |
38 | BuildRequires: python3-scandir >= 1.8 | |
39 | %endif | |
40 | %endif | |
792227e6 JB |
41 | %endif |
42 | Requires: python-modules >= 1:2.7 | |
43 | BuildArch: noarch | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | pyfakefs implements a fake file system that mocks the Python file | |
48 | system modules. Using pyfakefs, your tests operate on a fake file | |
49 | system in memory without touching the real disk. The software under | |
50 | test requires no modification to work with pyfakefs. | |
51 | ||
52 | %description -l pl.UTF-8 | |
53 | pyfakefs implementuje fałszywy system plików, będący atrapą dla | |
54 | modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy | |
55 | operują na fałszywym systemie plików w pamięci, bez dotykania | |
56 | prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji, | |
57 | aby działało z pyfakefs. | |
58 | ||
59 | %package -n python3-pyfakefs | |
60 | Summary: Fake file system that mocks the Python 3 file system modules | |
61 | Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików | |
62 | Group: Libraries/Python | |
937394ee | 63 | Requires: python3-modules >= 1:3.4 |
792227e6 JB |
64 | |
65 | %description -n python3-pyfakefs | |
66 | pyfakefs implements a fake file system that mocks the Python file | |
67 | system modules. Using pyfakefs, your tests operate on a fake file | |
68 | system in memory without touching the real disk. The software under | |
69 | test requires no modification to work with pyfakefs. | |
70 | ||
71 | %description -n python3-pyfakefs -l pl.UTF-8 | |
72 | pyfakefs implementuje fałszywy system plików, będący atrapą dla | |
73 | modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy | |
74 | operują na fałszywym systemie plików w pamięci, bez dotykania | |
75 | prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji, | |
76 | aby działało z pyfakefs. | |
77 | ||
78 | %package apidocs | |
79 | Summary: API documentation for Python pyfakefs module | |
80 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyfakefs | |
81 | Group: Documentation | |
82 | ||
83 | %description apidocs | |
84 | API documentation for Pythona pyfakefs module. | |
85 | ||
86 | %description apidocs -l pl.UTF-8 | |
87 | Dokumentacja API modułu Pythona pyfakefs. | |
88 | ||
89 | %prep | |
90 | %setup -q -n pyfakefs-%{version} | |
792227e6 JB |
91 | |
92 | %build | |
93 | export LC_ALL=C.UTF-8 | |
94 | %if %{with python2} | |
95 | %py_build | |
96 | ||
97 | %if %{with tests} | |
08eb5322 | 98 | %{__python} -m pyfakefs.tests.all_tests |
937394ee JB |
99 | # fails on pathlib |
100 | #%{__python} -m pyfakefs.tests.all_tests_without_extra_packages | |
101 | ||
102 | PYTHONPATH=$(pwd) \ | |
103 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
104 | PYTEST_PLUGINS=pyfakefs.pytest_plugin \ | |
105 | %{__python} -m pytest \ | |
106 | pyfakefs/pytest_tests/pytest_plugin_test.py | |
107 | # fails with python2 (any < 3.6?) | |
108 | #pyfakefs/pytest_tests/pytest_fixture_test.py | |
c45d0be8 JB |
109 | |
110 | PYTHONPATH=$(pwd) \ | |
111 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
112 | PYTEST_PLUGINS=pyfakefs.pytest_plugin \ | |
937394ee JB |
113 | %{__python} -m pytest \ |
114 | pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || : | |
115 | %{__python} -m pytest \ | |
116 | pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py | |
792227e6 JB |
117 | %endif |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %py3_build | |
122 | ||
123 | %if %{with tests} | |
08eb5322 | 124 | %{__python3} -m pyfakefs.tests.all_tests |
937394ee JB |
125 | %{__python3} -m pyfakefs.tests.all_tests_without_extra_packages |
126 | ||
127 | PYTHONPATH=$(pwd) \ | |
128 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
129 | PYTEST_PLUGINS=pyfakefs.pytest_plugin \ | |
130 | %{__python3} -m pytest \ | |
131 | pyfakefs/pytest_tests/pytest_fixture_test.py \ | |
132 | pyfakefs/pytest_tests/pytest_plugin_test.py | |
133 | ||
c45d0be8 JB |
134 | PYTHONPATH=$(pwd) \ |
135 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
136 | PYTEST_PLUGINS=pyfakefs.pytest_plugin \ | |
937394ee JB |
137 | %{__python3} -m pytest \ |
138 | pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || : | |
139 | %{__python3} -m pytest \ | |
140 | pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py | |
792227e6 JB |
141 | %endif |
142 | %endif | |
143 | ||
144 | %if %{with doc} | |
145 | %{__make} -C docs html | |
146 | %endif | |
147 | ||
148 | %install | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
151 | %if %{with python2} | |
152 | %py_install | |
153 | ||
154 | %py_postclean | |
155 | %endif | |
156 | ||
157 | %if %{with python3} | |
158 | %py3_install | |
159 | %endif | |
160 | ||
161 | %clean | |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
164 | %if %{with python2} | |
165 | %files | |
166 | %defattr(644,root,root,755) | |
167 | %doc CHANGES.md README.md | |
168 | %{py_sitescriptdir}/pyfakefs | |
169 | %{py_sitescriptdir}/pyfakefs-%{version}-py*.egg-info | |
170 | %endif | |
171 | ||
172 | %if %{with python3} | |
173 | %files -n python3-pyfakefs | |
174 | %defattr(644,root,root,755) | |
175 | %doc CHANGES.md README.md | |
176 | %{py3_sitescriptdir}/pyfakefs | |
177 | %{py3_sitescriptdir}/pyfakefs-%{version}-py*.egg-info | |
178 | %endif | |
179 | ||
180 | %if %{with doc} | |
181 | %files apidocs | |
182 | %defattr(644,root,root,755) | |
183 | %doc gh-pages/{_static,*.html,*.js} | |
184 | %endif |