]> git.pld-linux.org Git - packages/python-outcome.git/blob - python-outcome.spec
- new
[packages/python-outcome.git] / python-outcome.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_without  python3 # CPython 3.x module
7
8 Summary:        Capture the outcome of Python function calls
9 Summary(pl.UTF-8):      Przechwytywanie wyników wywołań funkcji pythonowych
10 Name:           python-outcome
11 # keep 1.0.x here for python2 support
12 Version:        1.0.1
13 Release:        1
14 License:        MIT or Apache v2.0
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/outcome/
17 Source0:        https://files.pythonhosted.org/packages/source/o/outcome/outcome-%{version}.tar.gz
18 # Source0-md5:  17e511c2bd1ee3cdd7a1aad29fe0133b
19 URL:            https://pypi.org/project/outcome/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-attrs >= 19.2.0
25 BuildRequires:  python-pytest
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-modules >= 1:3.5
30 BuildRequires:  python3-setuptools
31 %if %{with tests}
32 BuildRequires:  python3-async_generator
33 BuildRequires:  python3-attrs >= 19.2.0
34 BuildRequires:  python3-pytest
35 BuildRequires:  python3-pytest-asyncio
36 %endif
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 %if %{with doc}
41 BuildRequires:  python3-sphinx_rtd_theme
42 BuildRequires:  python3-sphinxcontrib-trio
43 BuildRequires:  sphinx-pdg-3
44 %endif
45 Requires:       python-modules >= 1:2.7
46 BuildArch:      noarch
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 Capture the outcome of Python function calls.
51
52 %description -l pl.UTF-8
53 Przechwytywanie wyników wywołań funkcji pythonowych.
54
55 %package -n python3-outcome
56 Summary:        Capture the outcome of Python function calls
57 Summary(pl.UTF-8):      Przechwytywanie wyników wywołań funkcji pythonowych
58 Group:          Libraries/Python
59 Requires:       python3-modules >= 1:3.5
60
61 %description -n python3-outcome
62 Capture the outcome of Python function calls.
63
64 %description -n python3-outcome -l pl.UTF-8
65 Przechwytywanie wyników wywołań funkcji pythonowych.
66
67 %package apidocs
68 Summary:        API documentation for Python outcome module
69 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona outcome
70 Group:          Documentation
71
72 %description apidocs
73 API documentation for Python outcome module.
74
75 %description apidocs -l pl.UTF-8
76 Dokumentacja API modułu Pythona outcome.
77
78 %prep
79 %setup -q -n outcome-%{version}
80
81 %build
82 %if %{with python2}
83 %py_build
84
85 %if %{with tests}
86 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
87 PYTEST_PLUGINS= \
88 PYTHONPATH=$(pwd)/src \
89 %{__python} -m pytest tests
90 %endif
91 %endif
92
93 %if %{with python3}
94 %py3_build
95
96 %if %{with tests}
97 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
98 PYTEST_PLUGINS="pytest_asyncio.plugin" \
99 PYTHONPATH=$(pwd)/src \
100 %{__python3} -m pytest tests
101 %endif
102 %endif
103
104 %if %{with doc}
105 PYTHONPATH=$(pwd)/src \
106 %{__make} -C docs html \
107         SPHINXBUILD=sphinx-build-3
108 %endif
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %py_install
115
116 %py_postclean
117 %endif
118
119 %if %{with python3}
120 %py3_install
121 %endif
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with python2}
127 %files
128 %defattr(644,root,root,755)
129 %doc LICENSE LICENSE.MIT README.rst
130 %{py_sitescriptdir}/outcome
131 %{py_sitescriptdir}/outcome-%{version}-py*.egg-info
132 %endif
133
134 %if %{with python3}
135 %files -n python3-outcome
136 %defattr(644,root,root,755)
137 %doc LICENSE LICENSE.MIT README.rst
138 %{py3_sitescriptdir}/outcome
139 %{py3_sitescriptdir}/outcome-%{version}-py*.egg-info
140 %endif
141
142 %if %{with doc}
143 %files apidocs
144 %defattr(644,root,root,755)
145 %doc docs/build/html/{_static,*.html,*.js}
146 %endif
This page took 0.114839 seconds and 3 git commands to generate.