]> git.pld-linux.org Git - SPECS.git/blob - python-testpath.spec
SPECS updated Wed 1 May 10:14:00 CEST 2024
[SPECS.git] / python-testpath.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_with     python3 # CPython 3.x module (built from python3-testpath.spec)
7
8 Summary:        Test utilities for code working with files and commands
9 Summary(pl.UTF-8):      Narzędzia testowe dla kodu działającego na plikach i poleceniach
10 Name:           python-testpath
11 # keep 0.4.x here for python2 support
12 Version:        0.4.4
13 Release:        2
14 License:        BSD
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/testpath/
17 Source0:        https://files.pythonhosted.org/packages/source/t/testpath/testpath-%{version}.tar.gz
18 # Source0-md5:  297100d49a6f20859383434a182cf426
19 URL:            https://pypi.org/project/testpath/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 %if %{with tests}
23 BuildRequires:  python-pathlib2
24 BuildRequires:  python-pytest
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.5
29 %if %{with tests}
30 BuildRequires:  python3-pytest
31 %endif
32 %endif
33 BuildRequires:  rpm-pythonprov
34 BuildRequires:  rpmbuild(macros) >= 1.714
35 %if %{with doc}
36 BuildRequires:  sphinx-pdg-2
37 %endif
38 Requires:       python-modules >= 1:2.7
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 Testpath is a collection of utilities for Python code working with
44 files and commands.
45
46 It contains functions to check things on the filesystem, and tools for
47 mocking system commands and recording calls to those.
48
49 %description -l pl.UTF-8
50 Testpath to zbiór narzędzi dla kodu w Pythonie działającego na plikach
51 i poleceniach.
52
53 Zawiera funkcje do sprawdzania elementów w systemie plików oraz
54 narzędzia do tworzenia atrap poleceń systemowych i zapisywania ich
55 wywołań.
56
57 %package -n python3-testpath
58 Summary:        Test utilities for code working with files and commands
59 Summary(pl.UTF-8):      Narzędzia testowe dla kodu działającego na plikach i poleceniach
60 Group:          Libraries/Python
61 Requires:       python3-modules >= 1:3.5
62
63 %description -n python3-testpath
64 Testpath is a collection of utilities for Python code working with
65 files and commands.
66
67 It contains functions to check things on the filesystem, and tools for
68 mocking system commands and recording calls to those.
69
70 %description -n python3-testpath -l pl.UTF-8
71 Testpath to zbiór narzędzi dla kodu w Pythonie działającego na plikach
72 i poleceniach.
73
74 Zawiera funkcje do sprawdzania elementów w systemie plików oraz
75 narzędzia do tworzenia atrap poleceń systemowych i zapisywania ich
76 wywołań.
77
78 %package apidocs
79 Summary:        API documentation for Python testpath module
80 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona testpath
81 Group:          Documentation
82
83 %description apidocs
84 API documentation for Python testpath module.
85
86 %description apidocs -l pl.UTF-8
87 Dokumentacja API modułu Pythona testpath.
88
89 %prep
90 %setup -q -n testpath-%{version}
91
92 %build
93 %if %{with python2}
94 %py_build
95
96 %if %{with tests}
97 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
98 %{__python} -m pytest tests
99 %endif
100 %endif
101
102 %if %{with python3}
103 %py3_build
104
105 %if %{with tests}
106 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
107 %{__python3} -m pytest tests
108 %endif
109 %endif
110
111 %if %{with doc}
112 %{__make} -C doc html \
113         SPHINXBUILD=sphinx-build-2
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 LICENSE README.rst
136 %{py_sitescriptdir}/testpath
137 %{py_sitescriptdir}/testpath-%{version}-py*.egg-info
138 %endif
139
140 %if %{with python3}
141 %files -n python3-testpath
142 %defattr(644,root,root,755)
143 %doc LICENSE README.rst
144 %{py3_sitescriptdir}/testpath
145 %{py3_sitescriptdir}/testpath-%{version}-py*.egg-info
146 %endif
147
148 %if %{with doc}
149 %files apidocs
150 %defattr(644,root,root,755)
151 %doc doc/_build/html/{_static,*.html,*.js}
152 %endif
This page took 0.123881 seconds and 4 git commands to generate.