]>
Commit | Line | Data |
---|---|---|
923ecd93 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 (for Python < 3.8) | |
7 | ||
8 | Summary: Read metadata from Python packages | |
9 | Summary(pl.UTF-8): Odczyt metadanych z pakietów Pythona | |
10 | Name: python-importlib_metadata | |
c8b208a4 JB |
11 | # keep 2.x here for python2 support |
12 | Version: 2.1.3 | |
13 | Release: 1 | |
923ecd93 JB |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/importlib-metadata/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/i/importlib-metadata/importlib_metadata-%{version}.tar.gz | |
c8b208a4 | 18 | # Source0-md5: 10bf15d611e8d61d6f7b3aa112196fca |
923ecd93 JB |
19 | URL: https://pypi.org/project/importlib-metadata/ |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
51b85812 | 22 | BuildRequires: python-setuptools >= 1:30.3 |
923ecd93 JB |
23 | BuildRequires: python-setuptools_scm |
24 | %if %{with tests} | |
25 | BuildRequires: python-configparser >= 3.5 | |
26 | BuildRequires: python-contextlib2 | |
c8b208a4 | 27 | BuildRequires: python-importlib_resources >= 1.3 |
923ecd93 JB |
28 | BuildRequires: python-packaging |
29 | BuildRequires: python-pathlib2 | |
c8b208a4 JB |
30 | BuildRequires: python-pep517 |
31 | BuildRequires: python-pyfakefs | |
32 | BuildRequires: python-unittest2 | |
923ecd93 JB |
33 | BuildRequires: python-zipp >= 0.5 |
34 | %endif | |
35 | %endif | |
36 | %if %{with python3} | |
422babe8 | 37 | BuildRequires: python3-modules >= 1:3.5 |
51b85812 | 38 | BuildRequires: python3-setuptools >= 1:30.3 |
923ecd93 JB |
39 | BuildRequires: python3-setuptools_scm |
40 | %if %{with tests} | |
c8b208a4 JB |
41 | %if "%{py3_ver}" < "3.9" |
42 | BuildRequires: python3-importlib_resources >= 1.3 | |
923ecd93 JB |
43 | %endif |
44 | BuildRequires: python3-packaging | |
c8b208a4 JB |
45 | BuildRequires: python3-pep517 |
46 | BuildRequires: python3-pyfakefs | |
923ecd93 JB |
47 | BuildRequires: python3-zipp >= 0.5 |
48 | %endif | |
49 | %endif | |
50 | BuildRequires: rpm-pythonprov | |
51 | BuildRequires: rpmbuild(macros) >= 1.714 | |
0d0bad29 | 52 | BuildRequires: sed >= 4.0 |
923ecd93 JB |
53 | %if %{with doc} |
54 | BuildRequires: python3-rst.linker | |
55 | BuildRequires: sphinx-pdg-3 | |
56 | %endif | |
57 | Requires: python-modules >= 1:2.7 | |
58 | BuildArch: noarch | |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %description | |
62 | importlib_metadata is a library to access the metadata for a Python | |
63 | package. It is intended to be ported to Python 3.8. | |
64 | ||
65 | %description -l pl.UTF-8 | |
66 | importlib_metadata to biblioteka służąca do dostępu do metadanych | |
67 | pakietów Pythona. Ma być przeniesiona do Pythona 3.8. | |
68 | ||
69 | %package -n python3-importlib_metadata | |
70 | Summary: Read metadata from Python packages | |
71 | Summary(pl.UTF-8): Odczyt metadanych z pakietów Pythona | |
72 | Group: Libraries/Python | |
422babe8 | 73 | Requires: python3-modules >= 1:3.5 |
923ecd93 JB |
74 | |
75 | %description -n python3-importlib_metadata | |
76 | importlib_metadata is a library to access the metadata for a Python | |
77 | package. It is intended to be ported to Python 3.8. | |
78 | ||
79 | %description -n python3-importlib_metadata -l pl.UTF-8 | |
80 | importlib_metadata to biblioteka służąca do dostępu do metadanych | |
81 | pakietów Pythona. Ma być przeniesiona do Pythona 3.8. | |
82 | ||
83 | %package apidocs | |
84 | Summary: API documentation for Python importlib_metadata module | |
85 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona importlib_metadata | |
86 | Group: Documentation | |
87 | ||
88 | %description apidocs | |
89 | API documentation for Python importlib_metadata module. | |
90 | ||
91 | %description apidocs -l pl.UTF-8 | |
92 | Dokumentacja API modułu Pythona importlib_metadata. | |
93 | ||
94 | %prep | |
95 | %setup -q -n importlib_metadata-%{version} | |
923ecd93 | 96 | |
0d0bad29 JB |
97 | %{__sed} -i -e '/LocalProjectTests/ i@unittest.skip("requires network")' tests/test_integration.py |
98 | ||
923ecd93 | 99 | %build |
c8b208a4 | 100 | export LC_ALL=C.UTF-8 |
923ecd93 | 101 | %if %{with python2} |
422babe8 JB |
102 | %py_build |
103 | ||
104 | %if %{with tests} | |
c8b208a4 | 105 | %{__python} -m unittest2 discover -s tests -t $(pwd) |
422babe8 | 106 | %endif |
923ecd93 JB |
107 | %endif |
108 | ||
109 | %if %{with python3} | |
422babe8 JB |
110 | %py3_build |
111 | ||
112 | %if %{with tests} | |
c8b208a4 | 113 | %{__python3} -m unittest discover -s tests -t $(pwd) |
422babe8 | 114 | %endif |
923ecd93 JB |
115 | %endif |
116 | ||
117 | %if %{with doc} | |
c8b208a4 | 118 | sphinx-build-3 -b html docs docs/_build/html |
923ecd93 JB |
119 | %endif |
120 | ||
121 | %install | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
124 | %if %{with python2} | |
125 | %py_install | |
126 | ||
127 | %py_postclean | |
128 | %endif | |
129 | ||
130 | %if %{with python3} | |
131 | %py3_install | |
132 | %endif | |
133 | ||
134 | %clean | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
137 | %if %{with python2} | |
138 | %files | |
139 | %defattr(644,root,root,755) | |
140 | %doc LICENSE README.rst | |
141 | %{py_sitescriptdir}/importlib_metadata | |
142 | %{py_sitescriptdir}/importlib_metadata-%{version}-py*.egg-info | |
143 | %endif | |
144 | ||
145 | %if %{with python3} | |
146 | %files -n python3-importlib_metadata | |
147 | %defattr(644,root,root,755) | |
148 | %doc LICENSE README.rst | |
149 | %{py3_sitescriptdir}/importlib_metadata | |
150 | %{py3_sitescriptdir}/importlib_metadata-%{version}-py*.egg-info | |
151 | %endif | |
152 | ||
153 | %if %{with doc} | |
154 | %files apidocs | |
155 | %defattr(644,root,root,755) | |
156 | %doc docs/_build/html/{_static,*.html,*.js} | |
157 | %endif |