]> git.pld-linux.org Git - packages/python-pluggy.git/blob - python-pluggy.spec
- disable pytest plugins
[packages/python-pluggy.git] / python-pluggy.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 %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}
12 # keep 0.13.x here for python2 support
13 Version:        0.13.1
14 Release:        2
15 License:        MIT
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/pluggy/
18 Source0:        https://files.pythonhosted.org/packages/source/p/pluggy/pluggy-%{version}.tar.gz
19 # Source0-md5:  7f610e28b8b34487336b585a3dfb803d
20 URL:            https://pypi.org/project/pluggy/
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 BuildRequires:  python-setuptools_scm
27 %if %{with tests}
28 BuildRequires:  python-importlib_metadata >= 0.12
29 BuildRequires:  python-pytest >= 3.7.0
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-modules >= 1:3.4
34 BuildRequires:  python3-setuptools
35 BuildRequires:  python3-setuptools_scm
36 %if %{with tests}
37 %if "%{py3_ver}" < "3.8"
38 BuildRequires:  python3-importlib_metadata >= 0.12
39 %endif
40 BuildRequires:  python3-pytest >= 3.7.0
41 %endif
42 %endif
43 %if %{with doc}
44 BuildRequires:  sphinx-pdg
45 %endif
46 Requires:       python-modules >= 1:2.7
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
62 Requires:       python3-modules >= 1:3.4
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
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
83 %prep
84 %setup -q -n %{module}-%{version}
85
86 %build
87 %if %{with python2}
88 %py_build
89
90 %if %{with tests}
91 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
92 PYTHONPATH=$(pwd)/src \
93 %{__python} -m pytest testing
94 %endif
95 %endif
96
97 %if %{with python3}
98 %py3_build
99
100 %if %{with tests}
101 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
102 PYTHONPATH=$(pwd)/src \
103 %{__python3} -m pytest testing
104 %endif
105 %endif
106
107 %if %{with doc}
108 PYTHONPATH="$PWD/src" \
109 sphinx-build -b html docs docs/_build/html
110 %endif
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %py_install
117
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)
131 %doc LICENSE README.rst
132 %{py_sitescriptdir}/pluggy
133 %{py_sitescriptdir}/pluggy-%{version}-py*.egg-info
134 %endif
135
136 %if %{with python3}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc LICENSE README.rst
140 %{py3_sitescriptdir}/pluggy
141 %{py3_sitescriptdir}/pluggy-%{version}-py*.egg-info
142 %endif
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
This page took 0.121277 seconds and 3 git commands to generate.