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