]>
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 | 11 | Version: 3.4.3 |
e3af7fbd | 12 | Release: 2 |
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 |
c45d0be8 JB |
92 | |
93 | PYTHONPATH=$(pwd) \ | |
94 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
95 | PYTEST_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 |
105 | PYTHONPATH=$(pwd) \ |
106 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
107 | PYTEST_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 | |
117 | rm -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 | |
130 | rm -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 |