]> git.pld-linux.org Git - packages/python-pyfakefs.git/blame - python-pyfakefs.spec
- fix tests with pyfakefs already installed
[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
08eb5322 11Version: 3.4.3
e3af7fbd 12Release: 2
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
08eb5322 17# Source0-md5: 8044a683bc025c0e2b2594b7d8de1083
792227e6
JB
18Patch0: %{name}-tests.patch
19URL: http://pyfakefs.org/
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.714
22%{?with_doc:BuildRequires: sphinx-pdg >= 1.0}
23%if %{with python2}
24BuildRequires: python-modules >= 1:2.7
25%{?with_tests:BuildRequires: python-pytest >= 2.8.6}
6a0c7f72 26%{?with_tests:BuildRequires: python-scandir}
792227e6
JB
27BuildRequires: python-setuptools
28%endif
29%if %{with python3}
30BuildRequires: python3-modules >= 1:3.3
31%{?with_tests:BuildRequires: python3-pytest >= 2.8.6}
32BuildRequires: python3-setuptools
33%endif
34Requires: python-modules >= 1:2.7
35BuildArch: noarch
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39pyfakefs implements a fake file system that mocks the Python file
40system modules. Using pyfakefs, your tests operate on a fake file
41system in memory without touching the real disk. The software under
42test requires no modification to work with pyfakefs.
43
44%description -l pl.UTF-8
45pyfakefs implementuje fałszywy system plików, będący atrapą dla
46modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
47operują na fałszywym systemie plików w pamięci, bez dotykania
48prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
49aby działało z pyfakefs.
50
51%package -n python3-pyfakefs
52Summary: Fake file system that mocks the Python 3 file system modules
53Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików
54Group: Libraries/Python
55Requires: python3-modules >= 1:3.3
56
57%description -n python3-pyfakefs
58pyfakefs implements a fake file system that mocks the Python file
59system modules. Using pyfakefs, your tests operate on a fake file
60system in memory without touching the real disk. The software under
61test requires no modification to work with pyfakefs.
62
63%description -n python3-pyfakefs -l pl.UTF-8
64pyfakefs implementuje fałszywy system plików, będący atrapą dla
65modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
66operują na fałszywym systemie plików w pamięci, bez dotykania
67prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
68aby działało z pyfakefs.
69
70%package apidocs
71Summary: API documentation for Python pyfakefs module
72Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyfakefs
73Group: Documentation
74
75%description apidocs
76API documentation for Pythona pyfakefs module.
77
78%description apidocs -l pl.UTF-8
79Dokumentacja API modułu Pythona pyfakefs.
80
81%prep
82%setup -q -n pyfakefs-%{version}
83%patch0 -p1
84
85%build
86export LC_ALL=C.UTF-8
87%if %{with python2}
88%py_build
89
90%if %{with tests}
08eb5322 91%{__python} -m pyfakefs.tests.all_tests
c45d0be8
JB
92
93PYTHONPATH=$(pwd) \
94PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
95PYTEST_PLUGINS=pyfakefs.pytest_plugin \
96%{__python} -m pytest pyfakefs/tests/pytest_plugin_test.py
792227e6
JB
97%endif
98%endif
99
100%if %{with python3}
101%py3_build
102
103%if %{with tests}
08eb5322 104%{__python3} -m pyfakefs.tests.all_tests
c45d0be8
JB
105PYTHONPATH=$(pwd) \
106PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
107PYTEST_PLUGINS=pyfakefs.pytest_plugin \
108%{__python3} -m pytest pyfakefs/tests/pytest_plugin_test.py
792227e6
JB
109%endif
110%endif
111
112%if %{with doc}
113%{__make} -C docs html
114%endif
115
116%install
117rm -rf $RPM_BUILD_ROOT
118
119%if %{with python2}
120%py_install
121
122%py_postclean
123%endif
124
125%if %{with python3}
126%py3_install
127%endif
128
129%clean
130rm -rf $RPM_BUILD_ROOT
131
132%if %{with python2}
133%files
134%defattr(644,root,root,755)
135%doc CHANGES.md README.md
136%{py_sitescriptdir}/pyfakefs
137%{py_sitescriptdir}/pyfakefs-%{version}-py*.egg-info
138%endif
139
140%if %{with python3}
141%files -n python3-pyfakefs
142%defattr(644,root,root,755)
143%doc CHANGES.md README.md
144%{py3_sitescriptdir}/pyfakefs
145%{py3_sitescriptdir}/pyfakefs-%{version}-py*.egg-info
146%endif
147
148%if %{with doc}
149%files apidocs
150%defattr(644,root,root,755)
151%doc gh-pages/{_static,*.html,*.js}
152%endif
This page took 0.101018 seconds and 4 git commands to generate.