]> git.pld-linux.org Git - SPECS.git/blob - python3-pyfakefs.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python3-pyfakefs.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5
6 Summary:        Fake file system that mocks the Python 3 file system modules
7 Summary(pl.UTF-8):      Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików
8 Name:           python3-pyfakefs
9 Version:        4.0.2
10 Release:        2
11 License:        Apache v2.0
12 Group:          Libraries/Python
13 #Source0Download: https://github.com/jmcgeheeiv/pyfakefs/releases
14 Source0:        https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}/pyfakefs-%{version}.tar.gz
15 # Source0-md5:  82a7decddd919da996b34d4a8de4ca72
16 URL:            http://pyfakefs.org/
17 BuildRequires:  python3-modules >= 1:3.5
18 BuildRequires:  python3-setuptools
19 %if %{with tests}
20 BuildRequires:  python3-pytest >= 2.8.6
21 %if "%{py3_ver}" < "3.6"
22 BuildRequires:  python3-pathlib2 >= 2.3.2
23 BuildRequires:  python3-scandir >= 1.8
24 %endif
25 %endif
26 BuildRequires:  rpm-pythonprov
27 BuildRequires:  rpmbuild(macros) >= 1.714
28 %{?with_doc:BuildRequires:      sphinx-pdg >= 1.0}
29 Requires:       python3-modules >= 1:3.5
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 pyfakefs implements a fake file system that mocks the Python file
35 system modules. Using pyfakefs, your tests operate on a fake file
36 system in memory without touching the real disk. The software under
37 test requires no modification to work with pyfakefs.
38
39 %description -l pl.UTF-8
40 pyfakefs implementuje fałszywy system plików, będący atrapą dla
41 modułów systemowych Pythona dla plików. Przy użyciu pyfakefs testy
42 operują na fałszywym systemie plików w pamięci, bez dotykania
43 prawdziwego dysku. Testowane oprogramowanie nie wymaga modyfikacji,
44 aby działało z pyfakefs.
45
46 %package apidocs
47 Summary:        API documentation for Python pyfakefs module
48 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona pyfakefs
49 Group:          Documentation
50
51 %description apidocs
52 API documentation for Pythona pyfakefs module.
53
54 %description apidocs -l pl.UTF-8
55 Dokumentacja API modułu Pythona pyfakefs.
56
57 %prep
58 %setup -q -n pyfakefs-%{version}
59
60 %build
61 #export LC_ALL=C.UTF-8
62 %py3_build
63
64 %if %{with tests}
65 %{__python3} -m pyfakefs.tests.all_tests
66 %{__python3} -m pyfakefs.tests.all_tests_without_extra_packages
67
68 PYTHONPATH=$(pwd) \
69 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
70 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
71 %{__python3} -m pytest \
72         pyfakefs/pytest_tests/pytest_fixture_test.py \
73         pyfakefs/pytest_tests/pytest_plugin_test.py
74
75 PYTHONPATH=$(pwd) \
76 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
77 PYTEST_PLUGINS=pyfakefs.pytest_plugin \
78 %{__python3} -m pytest \
79         pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || :
80 %{__python3} -m pytest \
81         pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
82 %endif
83
84 %if %{with doc}
85 %{__make} -C docs html
86 %endif
87
88 %install
89 rm -rf $RPM_BUILD_ROOT
90
91 %py3_install
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %files
97 %defattr(644,root,root,755)
98 %doc CHANGES.md README.md
99 %{py3_sitescriptdir}/pyfakefs
100 %{py3_sitescriptdir}/pyfakefs-%{version}-py*.egg-info
101
102 %if %{with doc}
103 %files apidocs
104 %defattr(644,root,root,755)
105 %doc gh-pages/{_static,*.html,*.js}
106 %endif
This page took 0.072007 seconds and 3 git commands to generate.