]>
Commit | Line | Data |
---|---|---|
23b43377 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
23b43377 JB |
5 | |
6 | Summary: Test utilities for code working with files and commands | |
7 | Summary(pl.UTF-8): Narzędzia testowe dla kodu działającego na plikach i poleceniach | |
5a4603a2 JB |
8 | Name: python3-testpath |
9 | Version: 0.6.0 | |
10 | Release: 1 | |
23b43377 JB |
11 | License: BSD |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/testpath/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/t/testpath/testpath-%{version}.tar.gz | |
5a4603a2 | 15 | # Source0-md5: 9fd4339f76da12d15bc718e4aa2566e9 |
23b43377 | 16 | URL: https://pypi.org/project/testpath/ |
23b43377 | 17 | BuildRequires: python3-modules >= 1:3.5 |
5a4603a2 | 18 | BuildRequires: python3-setuptools |
23b43377 JB |
19 | %if %{with tests} |
20 | BuildRequires: python3-pytest | |
21 | %endif | |
23b43377 JB |
22 | BuildRequires: rpm-pythonprov |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
24 | %if %{with doc} | |
5a4603a2 | 25 | BuildRequires: sphinx-pdg-3 |
23b43377 | 26 | %endif |
5a4603a2 | 27 | Requires: python3-modules >= 1:3.5 |
23b43377 JB |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Testpath is a collection of utilities for Python code working with | |
33 | files and commands. | |
34 | ||
35 | It contains functions to check things on the filesystem, and tools for | |
36 | mocking system commands and recording calls to those. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Testpath to zbiór narzędzi dla kodu w Pythonie działającego na plikach | |
40 | i poleceniach. | |
41 | ||
42 | Zawiera funkcje do sprawdzania elementów w systemie plików oraz | |
43 | narzędzia do tworzenia atrap poleceń systemowych i zapisywania ich | |
44 | wywołań. | |
45 | ||
23b43377 JB |
46 | %package apidocs |
47 | Summary: API documentation for Python testpath module | |
48 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona testpath | |
49 | Group: Documentation | |
50 | ||
51 | %description apidocs | |
52 | API documentation for Python testpath module. | |
53 | ||
54 | %description apidocs -l pl.UTF-8 | |
55 | Dokumentacja API modułu Pythona testpath. | |
56 | ||
57 | %prep | |
58 | %setup -q -n testpath-%{version} | |
59 | ||
5a4603a2 JB |
60 | # setuptools stub |
61 | cat >setup.py <<EOF | |
62 | from setuptools import setup | |
63 | setup() | |
64 | EOF | |
65 | ||
66 | # until we have flit... | |
67 | # (extracted from pyproject.toml - keep in sync!) | |
68 | cat >setup.cfg <<'EOF' | |
69 | [metadata] | |
70 | name = testpath | |
71 | version = %{version} | |
72 | description = Test utilities for code working with files and commands | |
73 | author = Jupyter Development Team | |
74 | author_email = jupyter@googlegroups.com | |
75 | license = BSD | |
76 | license_file = LICENSE | |
77 | classifiers = | |
78 | Intended Audience :: Developers | |
79 | License :: OSI Approved :: BSD License | |
80 | Programming Language :: Python | |
81 | Programming Language :: Python :: 3 | |
82 | Topic :: Software Development :: Testing | |
83 | [options] | |
84 | packages = testpath | |
85 | python_requires = >=3.5 | |
86 | EOF | |
23b43377 | 87 | |
5a4603a2 | 88 | %build |
23b43377 JB |
89 | %py3_build |
90 | ||
91 | %if %{with tests} | |
5a4603a2 | 92 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
23b43377 JB |
93 | %{__python3} -m pytest tests |
94 | %endif | |
23b43377 JB |
95 | |
96 | %if %{with doc} | |
5a4603a2 JB |
97 | %{__make} -C doc html \ |
98 | SPHINXBUILD=sphinx-build-3 | |
23b43377 JB |
99 | %endif |
100 | ||
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
23b43377 | 104 | %py3_install |
23b43377 JB |
105 | |
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
23b43377 JB |
109 | %files |
110 | %defattr(644,root,root,755) | |
111 | %doc LICENSE README.rst | |
23b43377 JB |
112 | %{py3_sitescriptdir}/testpath |
113 | %{py3_sitescriptdir}/testpath-%{version}-py*.egg-info | |
23b43377 JB |
114 | |
115 | %if %{with doc} | |
116 | %files apidocs | |
117 | %defattr(644,root,root,755) | |
118 | %doc doc/_build/html/{_static,*.html,*.js} | |
119 | %endif |