]> git.pld-linux.org Git - packages/python-pyfakefs.git/blame - python-pyfakefs.spec
- updated to 3.7.2; 3.4.x didn't support python 3.8
[packages/python-pyfakefs.git] / python-pyfakefs.spec
CommitLineData
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
8Summary: Fake file system that mocks the Python 2 file system modules
9Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 2 dla plików
10Name: python-pyfakefs
937394ee
JB
11Version: 3.7.2
12Release: 1
792227e6
JB
13License: Apache v2.0
14Group: Libraries/Python
15#Source0Download: https://github.com/jmcgeheeiv/pyfakefs/releases
16Source0: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}/pyfakefs-%{version}.tar.gz
937394ee 17# Source0-md5: e34234db867202b035d48a77d1c78d82
792227e6
JB
18URL: http://pyfakefs.org/
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
21%{?with_doc:BuildRequires: sphinx-pdg >= 1.0}
22%if %{with python2}
23BuildRequires: python-modules >= 1:2.7
792227e6 24BuildRequires: python-setuptools
937394ee
JB
25%if %{with tests}
26BuildRequires: python-pathlib2 >= 2.3.2
27BuildRequires: python-pytest >= 2.8.6
28BuildRequires: python-scandir >= 1.8
29%endif
792227e6
JB
30%endif
31%if %{with python3}
937394ee 32BuildRequires: python3-modules >= 1:3.4
792227e6 33BuildRequires: python3-setuptools
937394ee
JB
34%if %{with tests}
35BuildRequires: python3-pytest >= 2.8.6
36%if "%{py3_ver}" < "3.6"
37BuildRequires: python3-pathlib2 >= 2.3.2
38BuildRequires: python3-scandir >= 1.8
39%endif
40%endif
792227e6
JB
41%endif
42Requires: python-modules >= 1:2.7
43BuildArch: noarch
44BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46%description
47pyfakefs implements a fake file system that mocks the Python file
48system modules. Using pyfakefs, your tests operate on a fake file
49system in memory without touching the real disk. The software under
50test requires no modification to work with pyfakefs.
51
52%description -l pl.UTF-8
53pyfakefs implementuje fałszywy system plików, będący atrapą dla
54modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
55operują na fałszywym systemie plików w pamięci, bez dotykania
56prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
57aby działało z pyfakefs.
58
59%package -n python3-pyfakefs
60Summary: Fake file system that mocks the Python 3 file system modules
61Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików
62Group: Libraries/Python
937394ee 63Requires: python3-modules >= 1:3.4
792227e6
JB
64
65%description -n python3-pyfakefs
66pyfakefs implements a fake file system that mocks the Python file
67system modules. Using pyfakefs, your tests operate on a fake file
68system in memory without touching the real disk. The software under
69test requires no modification to work with pyfakefs.
70
71%description -n python3-pyfakefs -l pl.UTF-8
72pyfakefs implementuje fałszywy system plików, będący atrapą dla
73modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
74operują na fałszywym systemie plików w pamięci, bez dotykania
75prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
76aby działało z pyfakefs.
77
78%package apidocs
79Summary: API documentation for Python pyfakefs module
80Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyfakefs
81Group: Documentation
82
83%description apidocs
84API documentation for Pythona pyfakefs module.
85
86%description apidocs -l pl.UTF-8
87Dokumentacja API modułu Pythona pyfakefs.
88
89%prep
90%setup -q -n pyfakefs-%{version}
792227e6
JB
91
92%build
93export 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
102PYTHONPATH=$(pwd) \
103PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
104PYTEST_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
110PYTHONPATH=$(pwd) \
111PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
112PYTEST_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
127PYTHONPATH=$(pwd) \
128PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
129PYTEST_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
134PYTHONPATH=$(pwd) \
135PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
136PYTEST_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
149rm -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
162rm -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
This page took 0.122356 seconds and 4 git commands to generate.