]>
Commit | Line | Data |
---|---|---|
aa1205d1 JB |
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: Wrappers to build Python packages using PEP 517 hooks | |
9 | Summary(pl.UTF-8): Opakowanie do budowania pakietów Pythona przy użyciu uchwytów PEP 517 | |
10 | Name: python-pep517 | |
11 | Version: 0.10.0 | |
f3fdfb5d | 12 | Release: 2 |
aa1205d1 JB |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/pep517/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pep517/pep517-%{version}.tar.gz | |
17 | # Source0-md5: 59b482ecdc9f9153bd3183e8d0da99ff | |
18 | URL: https://pypi.org/project/pep517/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-importlib_metadata | |
24 | BuildRequires: python-pip | |
25 | BuildRequires: python-pytest | |
26 | BuildRequires: python-pytest-flake8 | |
27 | BuildRequires: python-toml | |
28 | BuildRequires: python-zipp | |
29 | %endif | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-modules >= 1:3.6 | |
33 | BuildRequires: python3-setuptools | |
34 | %if %{with tests} | |
35 | BuildRequires: python3-pip | |
36 | BuildRequires: python3-pytest | |
37 | BuildRequires: python3-pytest-flake8 | |
38 | BuildRequires: python3-toml | |
39 | %if "%{py3_ver}" < "3.8" | |
40 | BuildRequires: python3-importlib_metadata | |
41 | BuildRequires: python3-zipp | |
42 | %endif | |
43 | %endif | |
44 | %endif | |
45 | BuildRequires: rpm-pythonprov | |
46 | BuildRequires: rpmbuild(macros) >= 1.714 | |
47 | %if %{with doc} | |
48 | BuildRequires: python3-sphinx_rtd_theme | |
49 | BuildRequires: python3-toml | |
50 | BuildRequires: sphinx-pdg-3 | |
51 | %endif | |
52 | # replace with other requires if defined in setup.py | |
53 | Requires: python-modules >= 1:2.7 | |
54 | BuildArch: noarch | |
55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
56 | ||
57 | %description | |
58 | PEP 517 specifies a standard API for systems which build Python | |
59 | packages. | |
60 | ||
61 | %description -l pl.UTF-8 | |
62 | PEP 517 określa standardowe API dla systemów budujących pakiety | |
63 | Pythona. | |
64 | ||
65 | %package -n python3-pep517 | |
66 | Summary: Wrappers to build Python packages using PEP 517 hooks | |
67 | Summary(pl.UTF-8): Opakowanie do budowania pakietów Pythona przy użyciu uchwytów PEP 517 | |
68 | Group: Libraries/Python | |
69 | Requires: python3-modules >= 1:3.6 | |
70 | ||
71 | %description -n python3-pep517 | |
72 | PEP 517 specifies a standard API for systems which build Python | |
73 | packages. | |
74 | ||
75 | %description -n python3-pep517 -l pl.UTF-8 | |
76 | PEP 517 określa standardowe API dla systemów budujących pakiety | |
77 | Pythona. | |
78 | ||
79 | %package apidocs | |
80 | Summary: API documentation for Python pep517 module | |
81 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pep517 | |
82 | Group: Documentation | |
83 | ||
84 | %description apidocs | |
85 | API documentation for Python pep517 module. | |
86 | ||
87 | %description apidocs -l pl.UTF-8 | |
88 | Dokumentacja API modułu Pythona pep517. | |
89 | ||
90 | %prep | |
91 | %setup -q -n pep517-%{version} | |
92 | ||
93 | %build | |
94 | %if %{with python2} | |
95 | %py_build | |
96 | ||
97 | %if %{with tests} | |
98 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
99 | PYTEST_PLUGINS="pytest_flake8" \ | |
39a6e93e | 100 | %{__python} -m pytest tests -k 'not test_classic_package' |
aa1205d1 JB |
101 | %endif |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_build | |
106 | ||
107 | %if %{with tests} | |
108 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
109 | PYTEST_PLUGINS="pytest_flake8" \ | |
7e62171e | 110 | %{__python3} -m pytest tests -k 'not test_classic_package and not test_meta_for_this_package and not test_meta_output' |
aa1205d1 JB |
111 | %endif |
112 | %endif | |
113 | ||
114 | %if %{with doc} | |
115 | %{__make} -C doc html \ | |
116 | SPHINXBUILD=sphinx-build-3 | |
117 | %endif | |
118 | ||
119 | %install | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %if %{with python2} | |
123 | %py_install | |
124 | ||
125 | # _in_process.py is executed by filename | |
126 | %py_postclean -x _in_process.py | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %py3_install | |
131 | %endif | |
132 | ||
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %if %{with python2} | |
137 | %files | |
138 | %defattr(644,root,root,755) | |
139 | %doc LICENSE README.rst | |
140 | %{py_sitescriptdir}/pep517 | |
141 | %{py_sitescriptdir}/pep517-%{version}-py*.egg-info | |
142 | %endif | |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-pep517 | |
146 | %defattr(644,root,root,755) | |
147 | # copy %doc from python2 package here | |
148 | %{py3_sitescriptdir}/pep517 | |
149 | %{py3_sitescriptdir}/pep517-%{version}-py*.egg-info | |
150 | %endif | |
151 | ||
152 | %if %{with doc} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %doc doc/_build/html/{_static,*.html,*.js} | |
156 | %endif |