1 # NOTE: for versions >= 4 for python 3.5+ see python3-pyfakefs.spec
4 %bcond_without doc # Sphinx documentation
5 %bcond_without tests # unit tests
6 %bcond_without python2 # CPython 2.x module
7 %bcond_with python3 # CPython 3.x module (built from python3-pyfakefs.spec)
9 Summary: Fake file system that mocks the Python 2 file system modules
10 Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 2 dla plików
12 # NOTE: keep 3.x for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://github.com/jmcgeheeiv/pyfakefs/releases
18 Source0: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}/pyfakefs-%{version}.tar.gz
19 # Source0-md5: e34234db867202b035d48a77d1c78d82
20 URL: http://pyfakefs.org/
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
23 %{?with_doc:BuildRequires: sphinx-pdg >= 1.0}
25 BuildRequires: python-modules >= 1:2.7
26 BuildRequires: python-setuptools
28 BuildRequires: python-pathlib2 >= 2.3.2
29 BuildRequires: python-pytest >= 2.8.6
30 BuildRequires: python-scandir >= 1.8
34 BuildRequires: python3-modules >= 1:3.4
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-pytest >= 2.8.6
38 %if "%{py3_ver}" < "3.6"
39 BuildRequires: python3-pathlib2 >= 2.3.2
40 BuildRequires: python3-scandir >= 1.8
44 Requires: python-modules >= 1:2.7
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 pyfakefs implements a fake file system that mocks the Python file
50 system modules. Using pyfakefs, your tests operate on a fake file
51 system in memory without touching the real disk. The software under
52 test requires no modification to work with pyfakefs.
54 %description -l pl.UTF-8
55 pyfakefs implementuje fałszywy system plików, będący atrapą dla
56 modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
57 operują na fałszywym systemie plików w pamięci, bez dotykania
58 prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
59 aby działało z pyfakefs.
61 %package -n python3-pyfakefs
62 Summary: Fake file system that mocks the Python 3 file system modules
63 Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików
64 Group: Libraries/Python
65 Requires: python3-modules >= 1:3.4
67 %description -n python3-pyfakefs
68 pyfakefs implements a fake file system that mocks the Python file
69 system modules. Using pyfakefs, your tests operate on a fake file
70 system in memory without touching the real disk. The software under
71 test requires no modification to work with pyfakefs.
73 %description -n python3-pyfakefs -l pl.UTF-8
74 pyfakefs implementuje fałszywy system plików, będący atrapą dla
75 modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
76 operują na fałszywym systemie plików w pamięci, bez dotykania
77 prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
78 aby działało z pyfakefs.
81 Summary: API documentation for Python pyfakefs module
82 Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyfakefs
86 API documentation for Pythona pyfakefs module.
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API modułu Pythona pyfakefs.
92 %setup -q -n pyfakefs-%{version}
100 %{__python} -m pyfakefs.tests.all_tests
102 #%{__python} -m pyfakefs.tests.all_tests_without_extra_packages
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
107 %{__python} -m pytest \
108 pyfakefs/pytest_tests/pytest_plugin_test.py
109 # fails with python2 (any < 3.6?)
110 #pyfakefs/pytest_tests/pytest_fixture_test.py
113 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
114 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
115 %{__python} -m pytest \
116 pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || :
117 %{__python} -m pytest \
118 pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
126 %{__python3} -m pyfakefs.tests.all_tests
127 %{__python3} -m pyfakefs.tests.all_tests_without_extra_packages
130 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
131 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
132 %{__python3} -m pytest \
133 pyfakefs/pytest_tests/pytest_fixture_test.py \
134 pyfakefs/pytest_tests/pytest_plugin_test.py
137 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
138 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
139 %{__python3} -m pytest \
140 pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || :
141 %{__python3} -m pytest \
142 pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
147 %{__make} -C docs html
151 rm -rf $RPM_BUILD_ROOT
164 rm -rf $RPM_BUILD_ROOT
168 %defattr(644,root,root,755)
169 %doc CHANGES.md README.md
170 %{py_sitescriptdir}/pyfakefs
171 %{py_sitescriptdir}/pyfakefs-%{version}-py*.egg-info
175 %files -n python3-pyfakefs
176 %defattr(644,root,root,755)
177 %doc CHANGES.md README.md
178 %{py3_sitescriptdir}/pyfakefs
179 %{py3_sitescriptdir}/pyfakefs-%{version}-py*.egg-info
184 %defattr(644,root,root,755)
185 %doc gh-pages/{_static,*.html,*.js}