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