]>
Commit | Line | Data |
---|---|---|
455112cb JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
455112cb JB |
5 | |
6 | Summary: Capture the outcome of Python function calls | |
7 | Summary(pl.UTF-8): Przechwytywanie wyników wywołań funkcji pythonowych | |
77d8f197 JB |
8 | Name: python3-outcome |
9 | Version: 1.1.0 | |
455112cb JB |
10 | Release: 1 |
11 | License: MIT or Apache v2.0 | |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/outcome/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/o/outcome/outcome-%{version}.tar.gz | |
77d8f197 | 15 | # Source0-md5: 30184431b681fe2d5460a2344b904aba |
455112cb | 16 | URL: https://pypi.org/project/outcome/ |
77d8f197 | 17 | BuildRequires: python3-modules >= 1:3.6 |
455112cb JB |
18 | BuildRequires: python3-setuptools |
19 | %if %{with tests} | |
455112cb JB |
20 | BuildRequires: python3-attrs >= 19.2.0 |
21 | BuildRequires: python3-pytest | |
22 | BuildRequires: python3-pytest-asyncio | |
23 | %endif | |
455112cb JB |
24 | BuildRequires: rpm-pythonprov |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | %if %{with doc} | |
27 | BuildRequires: python3-sphinx_rtd_theme | |
28 | BuildRequires: python3-sphinxcontrib-trio | |
29 | BuildRequires: sphinx-pdg-3 | |
30 | %endif | |
77d8f197 | 31 | Requires: python3-modules >= 1:3.6 |
455112cb JB |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Capture the outcome of Python function calls. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Przechwytywanie wyników wywołań funkcji pythonowych. | |
40 | ||
455112cb JB |
41 | %package apidocs |
42 | Summary: API documentation for Python outcome module | |
43 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona outcome | |
44 | Group: Documentation | |
45 | ||
46 | %description apidocs | |
47 | API documentation for Python outcome module. | |
48 | ||
49 | %description apidocs -l pl.UTF-8 | |
50 | Dokumentacja API modułu Pythona outcome. | |
51 | ||
52 | %prep | |
53 | %setup -q -n outcome-%{version} | |
54 | ||
55 | %build | |
455112cb JB |
56 | %py3_build |
57 | ||
58 | %if %{with tests} | |
59 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
60 | PYTEST_PLUGINS="pytest_asyncio.plugin" \ | |
61 | PYTHONPATH=$(pwd)/src \ | |
62 | %{__python3} -m pytest tests | |
63 | %endif | |
455112cb JB |
64 | |
65 | %if %{with doc} | |
66 | PYTHONPATH=$(pwd)/src \ | |
67 | %{__make} -C docs html \ | |
68 | SPHINXBUILD=sphinx-build-3 | |
69 | %endif | |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
455112cb | 74 | %py3_install |
455112cb JB |
75 | |
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
455112cb JB |
79 | %files |
80 | %defattr(644,root,root,755) | |
81 | %doc LICENSE LICENSE.MIT README.rst | |
455112cb JB |
82 | %{py3_sitescriptdir}/outcome |
83 | %{py3_sitescriptdir}/outcome-%{version}-py*.egg-info | |
455112cb JB |
84 | |
85 | %if %{with doc} | |
86 | %files apidocs | |
87 | %defattr(644,root,root,755) | |
88 | %doc docs/build/html/{_static,*.html,*.js} | |
89 | %endif |