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