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