]> git.pld-linux.org Git - packages/python-importlib_metadata.git/blob - python-importlib_metadata.spec
ef8de215d90784475064e901d440c80490c18b87
[packages/python-importlib_metadata.git] / python-importlib_metadata.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_with     python3 # CPython 3.x module (for Python < 3.8; newer built from python3-importlib_metadata.spec)
7
8 Summary:        Read metadata from Python packages
9 Summary(pl.UTF-8):      Odczyt metadanych z pakietów Pythona
10 Name:           python-importlib_metadata
11 # keep 2.x here for python2 support
12 Version:        2.1.3
13 Release:        3.1
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
18 # Source0-md5:  10bf15d611e8d61d6f7b3aa112196fca
19 URL:            https://pypi.org/project/importlib-metadata/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools >= 1:30.3
23 BuildRequires:  python-setuptools_scm
24 %if %{with tests}
25 BuildRequires:  python-configparser >= 3.5
26 BuildRequires:  python-contextlib2
27 BuildRequires:  python-importlib_resources >= 1.3
28 BuildRequires:  python-packaging
29 BuildRequires:  python-pathlib2
30 BuildRequires:  python-pep517
31 BuildRequires:  python-pyfakefs
32 BuildRequires:  python-unittest2
33 BuildRequires:  python-zipp >= 0.5
34 %endif
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3-modules >= 1:3.5
38 BuildRequires:  python3-setuptools >= 1:30.3
39 BuildRequires:  python3-setuptools_scm
40 %if %{with tests}
41 %if "%{_ver_lt '%{py3_ver}' '3.9'}" == "1"
42 BuildRequires:  python3-importlib_resources >= 1.3
43 %endif
44 BuildRequires:  python3-packaging
45 BuildRequires:  python3-pep517
46 BuildRequires:  python3-pyfakefs
47 BuildRequires:  python3-zipp >= 0.5
48 %endif
49 %endif
50 BuildRequires:  rpm-pythonprov
51 BuildRequires:  rpmbuild(macros) >= 1.749
52 BuildRequires:  sed >= 4.0
53 %if %{with doc}
54 BuildRequires:  python-rst.linker
55 BuildRequires:  sphinx-pdg-2
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
73 Requires:       python3-modules >= 1:3.5
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}
96
97 %{__sed} -i -e '/LocalProjectTests/ i@unittest.skip("requires network")' tests/test_integration.py
98
99 %build
100 export LC_ALL=C.UTF-8
101 %if %{with python2}
102 %py_build
103
104 %if %{with tests}
105 %{__python} -m unittest2 discover -s tests -t $(pwd)
106 %endif
107 %endif
108
109 %if %{with python3}
110 %py3_build
111
112 %if %{with tests}
113 %{__python3} -m unittest discover -s tests -t $(pwd)
114 %endif
115 %endif
116
117 %if %{with doc}
118 sphinx-build-2 -b html docs docs/_build/html
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
This page took 0.030191 seconds and 2 git commands to generate.