]>
Commit | Line | Data |
---|---|---|
5f61b62e | 1 | # |
1e47850e | 2 | # Conditional build: |
54f89123 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
1e47850e MK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module pluggy | |
9 | Summary: Plugin and hook calling mechanisms for Python | |
10 | Summary(pl.UTF-8): Mechanizmy wtyczek dla Pythona | |
11 | Name: python-%{module} | |
f386a100 | 12 | # keep 0.13.x here for python2 support |
54f89123 | 13 | Version: 0.13.1 |
78a16753 | 14 | Release: 2 |
1e47850e MK |
15 | License: MIT |
16 | Group: Libraries/Python | |
73aad6e5 JB |
17 | #Source0Download: https://pypi.org/simple/pluggy/ |
18 | Source0: https://files.pythonhosted.org/packages/source/p/pluggy/pluggy-%{version}.tar.gz | |
54f89123 | 19 | # Source0-md5: 7f610e28b8b34487336b585a3dfb803d |
73aad6e5 | 20 | URL: https://pypi.org/project/pluggy/ |
1e47850e MK |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
73aad6e5 | 24 | BuildRequires: python-modules >= 1:2.7 |
6239e403 | 25 | BuildRequires: python-setuptools |
54f89123 | 26 | BuildRequires: python-setuptools_scm |
73aad6e5 | 27 | %if %{with tests} |
54f89123 | 28 | BuildRequires: python-importlib_metadata >= 0.12 |
353810d8 | 29 | BuildRequires: python-pytest >= 3.7.0 |
73aad6e5 | 30 | %endif |
1e47850e MK |
31 | %endif |
32 | %if %{with python3} | |
73aad6e5 | 33 | BuildRequires: python3-modules >= 1:3.4 |
6239e403 | 34 | BuildRequires: python3-setuptools |
54f89123 | 35 | BuildRequires: python3-setuptools_scm |
73aad6e5 | 36 | %if %{with tests} |
54f89123 JB |
37 | %if "%{py3_ver}" < "3.8" |
38 | BuildRequires: python3-importlib_metadata >= 0.12 | |
39 | %endif | |
353810d8 | 40 | BuildRequires: python3-pytest >= 3.7.0 |
1e47850e | 41 | %endif |
73aad6e5 | 42 | %endif |
54f89123 JB |
43 | %if %{with doc} |
44 | BuildRequires: sphinx-pdg | |
45 | %endif | |
73aad6e5 | 46 | Requires: python-modules >= 1:2.7 |
1e47850e MK |
47 | BuildArch: noarch |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
49 | ||
50 | %description | |
51 | Plugin manager as used by pytest but stripped of pytest specific | |
52 | details. | |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | Zarządca wtyczek tak jak używany przez pytest, ale pozbawiony detali | |
56 | specyficznych dla pytest. | |
57 | ||
58 | %package -n python3-%{module} | |
59 | Summary: Plugin and hook calling mechanisms for Python | |
60 | Summary(pl.UTF-8): Mechanizmy wtyczek dla Pythona | |
61 | Group: Libraries/Python | |
73aad6e5 | 62 | Requires: python3-modules >= 1:3.4 |
1e47850e MK |
63 | |
64 | %description -n python3-%{module} | |
65 | Plugin manager as used by pytest but stripped of pytest specific | |
66 | details. | |
67 | ||
68 | %description -n python3-%{module} -l pl.UTF-8 | |
69 | Zarządca wtyczek tak jak używany przez pytest, ale pozbawiony detali | |
70 | specyficznych dla pytest. | |
71 | ||
54f89123 JB |
72 | %package apidocs |
73 | Summary: API documentation for Python pluggy module | |
74 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pluggy | |
75 | Group: Documentation | |
76 | ||
77 | %description apidocs | |
78 | API documentation for Python pluggy module. | |
79 | ||
80 | %description apidocs -l pl.UTF-8 | |
81 | Dokumentacja API modułu Pythona pluggy. | |
82 | ||
1e47850e MK |
83 | %prep |
84 | %setup -q -n %{module}-%{version} | |
85 | ||
86 | %build | |
87 | %if %{with python2} | |
73aad6e5 JB |
88 | %py_build |
89 | ||
90 | %if %{with tests} | |
f386a100 | 91 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
54f89123 | 92 | PYTHONPATH=$(pwd)/src \ |
73aad6e5 JB |
93 | %{__python} -m pytest testing |
94 | %endif | |
1e47850e MK |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
73aad6e5 | 98 | %py3_build |
1e47850e | 99 | |
73aad6e5 | 100 | %if %{with tests} |
f386a100 | 101 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
54f89123 | 102 | PYTHONPATH=$(pwd)/src \ |
73aad6e5 JB |
103 | %{__python3} -m pytest testing |
104 | %endif | |
1e47850e MK |
105 | %endif |
106 | ||
54f89123 | 107 | %if %{with doc} |
f386a100 JB |
108 | PYTHONPATH="$PWD/src" \ |
109 | sphinx-build -b html docs docs/_build/html | |
54f89123 JB |
110 | %endif |
111 | ||
1e47850e MK |
112 | %install |
113 | rm -rf $RPM_BUILD_ROOT | |
73aad6e5 | 114 | |
1e47850e MK |
115 | %if %{with python2} |
116 | %py_install | |
73aad6e5 | 117 | |
1e47850e MK |
118 | %py_postclean |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
122 | %py3_install | |
123 | %endif | |
124 | ||
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %if %{with python2} | |
129 | %files | |
130 | %defattr(644,root,root,755) | |
73aad6e5 JB |
131 | %doc LICENSE README.rst |
132 | %{py_sitescriptdir}/pluggy | |
133 | %{py_sitescriptdir}/pluggy-%{version}-py*.egg-info | |
1e47850e | 134 | %endif |
1e47850e MK |
135 | |
136 | %if %{with python3} | |
137 | %files -n python3-%{module} | |
138 | %defattr(644,root,root,755) | |
73aad6e5 JB |
139 | %doc LICENSE README.rst |
140 | %{py3_sitescriptdir}/pluggy | |
141 | %{py3_sitescriptdir}/pluggy-%{version}-py*.egg-info | |
1e47850e | 142 | %endif |
54f89123 JB |
143 | |
144 | %if %{with doc} | |
145 | %files apidocs | |
146 | %defattr(644,root,root,755) | |
147 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
148 | %endif |