]> git.pld-linux.org Git - packages/python-future.git/blame - python-future.spec
rebuild with python 3.10
[packages/python-future.git] / python-future.spec
CommitLineData
8821ece5
JP
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
d03e8fee
JB
5%bcond_without doc # API documentation
6%bcond_without tests # unit tests
8821ece5
JP
7
8Summary: Clean single-source support for Python 3 and 2
d03e8fee 9Summary(pl.UTF-8): Czysta obsługa Pythona 3 i 2 w jednych źródłach
8821ece5 10Name: python-future
32cf6268 11Version: 0.18.2
0379646c 12Release: 4
8821ece5
JP
13License: MIT
14Group: Libraries/Python
d03e8fee
JB
15#Source0Download: https://pypi.org/simple/future/
16Source0: https://files.pythonhosted.org/packages/source/f/future/future-%{version}.tar.gz
32cf6268 17# Source0-md5: e4579c836b9c025872efe230f6270349
8f33d0a9 18Patch0: %{name}-tests.patch
8821ece5
JP
19URL: https://python-future.org/
20%if %{with python2}
d03e8fee 21BuildRequires: python-modules >= 1:2.6
8821ece5 22BuildRequires: python-setuptools
d03e8fee
JB
23%if "%{py_ver}" < "2.7"
24BuildRequires: python-argparse
25BuildRequires: python-importlib
26%if %{with tests}
32cf6268 27BuildRequires: python-2to3
d03e8fee
JB
28BuildRequires: python-unittest2
29%endif
30%endif
8821ece5
JP
31%endif
32%if %{with python3}
33BuildRequires: python3-modules >= 1:3.3
34BuildRequires: python3-setuptools
35%endif
36BuildRequires: rpm-pythonprov
37BuildRequires: rpmbuild(macros) >= 1.714
d03e8fee
JB
38%if %{with doc}
39BuildRequires: python3-sphinx_bootstrap_theme
40BuildRequires: sphinx-pdg-3
41%endif
42Requires: python-modules >= 1:2.6
43%if "%{py_ver}" < "2.7"
44Requires: python-argparse
45Requires: python-importlib
46Requires: python-unittest2
47%endif
8821ece5
JP
48BuildArch: noarch
49BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51%description
52future is the missing compatibility layer between Python 2 and
53Python 3. It allows you to use a single, clean Python 3.x-compatible
54codebase to support both Python 2 and Python 3 with minimal overhead.
55
d03e8fee
JB
56%description -l pl.UTF-8
57future to brakująca warstwa zgodności między Pythonem 2 i 3. Pozwala
58na używanie pojedynczego kodu źródłowego w Pythonie 3.x do obsługi
59zarówno Pythona 2, jak i 3 z minimalnym narzutem.
60
8821ece5
JP
61%package -n python3-future
62Summary: Clean single-source support for Python 3 and 2
d03e8fee 63Summary(pl.UTF-8): Czysta obsługa Pythona 3 i 2 w jednych źródłach
8821ece5
JP
64Group: Libraries/Python
65Requires: python3-modules >= 1:3.3
66
67%description -n python3-future
68future is the missing compatibility layer between Python 2 and
69Python 3. It allows you to use a single, clean Python 3.x-compatible
70codebase to support both Python 2 and Python 3 with minimal overhead.
71
d03e8fee
JB
72%description -n python3-future -l pl.UTF-8
73future to brakująca warstwa zgodności między Pythonem 2 i 3. Pozwala
74na używanie pojedynczego kodu źródłowego w Pythonie 3.x do obsługi
75zarówno Pythona 2, jak i 3 z minimalnym narzutem.
76
77%package apidocs
78Summary: API documentation for Python future module
79Summary(pl.UTF-8): Dokumentacja API modułu Pythona future
80Group: Documentation
81
82%description apidocs
83API documentation for Python future module.
84
85%description apidocs -l pl.UTF-8
86Dokumentacja API modułu Pythona future.
87
8821ece5
JP
88%prep
89%setup -q -n future-%{version}
d03e8fee 90%patch0 -p1
8821ece5
JP
91
92%build
93%if %{with python2}
94%py_build
d03e8fee
JB
95
96%if %{with tests}
97PYTHONPATH=$(pwd)/build-2/lib \
98%{__python} -m unittest discover -s tests
99%endif
8821ece5
JP
100%endif
101
102%if %{with python3}
103%py3_build
d03e8fee
JB
104
105%if %{with tests}
5a09ca9d
JB
106# FIXME: fail with py3.9(?) as of future-0.18.2
107%{__rm} tests/test_future/test_standard_library.py \
108 tests/test_future/test_urllib_toplevel.py \
109 tests/test_past/test_translation.py
d03e8fee
JB
110
111PYTHONPATH=$(pwd)/build-3/lib \
112%{__python3} -m unittest discover -s tests
113%endif
114%endif
115
116%if %{with doc}
117PYTHONPATH=$(pwd)/build-3/lib \
118%{__make} -C docs html \
119 SPHINXBUILD=sphinx-build-3
8821ece5
JP
120%endif
121
122%install
123rm -rf $RPM_BUILD_ROOT
124
125%if %{with python2}
126%py_install
127
128%py_postclean
d03e8fee
JB
129
130%{__mv} $RPM_BUILD_ROOT%{_bindir}/futurize{,-2}
131%{__mv} $RPM_BUILD_ROOT%{_bindir}/pasteurize{,-2}
8821ece5
JP
132%endif
133
134%if %{with python3}
135%py3_install
d03e8fee
JB
136
137%{__mv} $RPM_BUILD_ROOT%{_bindir}/futurize{,-3}
138%{__mv} $RPM_BUILD_ROOT%{_bindir}/pasteurize{,-3}
139
140ln -sf futurize-3 $RPM_BUILD_ROOT%{_bindir}/futurize
141ln -sf pasteurize-3 $RPM_BUILD_ROOT%{_bindir}/pasteurize
8821ece5
JP
142%endif
143
144%clean
145rm -rf $RPM_BUILD_ROOT
146
147%if %{with python2}
148%files
149%defattr(644,root,root,755)
d03e8fee
JB
150%doc LICENSE.txt README.rst
151%attr(755,root,root) %{_bindir}/futurize-2
152%attr(755,root,root) %{_bindir}/pasteurize-2
8821ece5
JP
153%{py_sitescriptdir}/_dummy_thread
154%{py_sitescriptdir}/_markupbase
155%{py_sitescriptdir}/_thread
156%{py_sitescriptdir}/builtins
157%{py_sitescriptdir}/copyreg
158%{py_sitescriptdir}/future
159%{py_sitescriptdir}/html
160%{py_sitescriptdir}/http
161%{py_sitescriptdir}/libfuturize
162%{py_sitescriptdir}/libpasteurize
163%{py_sitescriptdir}/past
164%{py_sitescriptdir}/queue
165%{py_sitescriptdir}/reprlib
166%{py_sitescriptdir}/socketserver
167%{py_sitescriptdir}/tkinter
168%{py_sitescriptdir}/winreg
169%{py_sitescriptdir}/xmlrpc
170%{py_sitescriptdir}/future-%{version}-py*.egg-info
171%endif
172
173%if %{with python3}
174%files -n python3-future
175%defattr(644,root,root,755)
d03e8fee
JB
176%doc LICENSE.txt README.rst
177%attr(755,root,root) %{_bindir}/futurize
178%attr(755,root,root) %{_bindir}/futurize-3
179%attr(755,root,root) %{_bindir}/pasteurize
180%attr(755,root,root) %{_bindir}/pasteurize-3
8821ece5
JP
181%{py3_sitescriptdir}/future
182%{py3_sitescriptdir}/libfuturize
183%{py3_sitescriptdir}/libpasteurize
184%{py3_sitescriptdir}/past
185%{py3_sitescriptdir}/future-%{version}-py*.egg-info
186%endif
d03e8fee
JB
187
188%if %{with doc}
189%files apidocs
190%defattr(644,root,root,755)
191%doc docs/build/html/{_modules,_static,*.html,*.js}
192%endif
This page took 0.087865 seconds and 4 git commands to generate.