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