Remove the python3-tools package (bz#1312030)

For more details see https://bugzilla.redhat.com/show_bug.cgi?id=1312030

Scope:

- Remove the python3-tools package and `Tools/` library
- Move /usr/bin/2to3 to python3-devel
- Move /usr/bin/idle and idlelib to python3-idle
- Provide python3-tools from python3-idle to keep upgrades sane
- Remove tests for tools from python3-tests package

Backported from https://src.fedoraproject.org/rpms/python37/pull-request/4
This commit is contained in:
Iryna Shcherbina 2018-01-18 22:57:38 +01:00
parent 2bcebb2b16
commit d938460ea1

View File

@ -14,7 +14,7 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version, # WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well # remember to update the python3-docs package as well
Version: %{pybasever}.4 Version: %{pybasever}.4
Release: 13%{?dist} Release: 14%{?dist}
License: Python License: Python
@ -505,8 +505,21 @@ Requires: python3-rpm-generators
# TODO change to a specific subpackage once available (#1218294) # TODO change to a specific subpackage once available (#1218294)
Requires: redhat-rpm-config Requires: redhat-rpm-config
Provides: %{name}-2to3 = %{version}-%{release}
Provides: 2to3 = %{version}-%{release}
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
# https://bugzilla.redhat.com/show_bug.cgi?id=1111275
# /usr/bin/2to3 was moved from python2-tools to python3-tools
# TODO Remove in Fedora 29
Conflicts: python2-tools < 2.7.13-17
Conflicts: python-tools < 2.7.13-17
# https://bugzilla.redhat.com/show_bug.cgi?id=1312030
# /usr/bin/2to3 was moved from python3-tools to python3-devel
# TODO Remove in Fedora 30
Conflicts: python3-tools < 3.6.4-14
# Shall be removed in Fedora 31 # Shall be removed in Fedora 31
Obsoletes: platform-python-devel < %{platpyver} Obsoletes: platform-python-devel < %{platpyver}
@ -515,32 +528,35 @@ This package contains the header files and configuration needed to compile
Python extension modules (typically written in C or C++), to embed Python Python extension modules (typically written in C or C++), to embed Python
into other programs, and to make binary distributions for Python libraries. into other programs, and to make binary distributions for Python libraries.
It also contains the necessary macros to build RPM packages with Python modules. It also contains the necessary macros to build RPM packages with Python modules
and 2to3 tool, an automatic source converter from Python 2.X.
%package tools %package idle
Summary: A collection of tools included with Python including 2to3 and idle Summary: A basic graphical development environment for Python
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: %{name}-tkinter = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release}
Provides: %{name}-2to3 = %{version}-%{release}
Provides: %{name}-idle = %{version}-%{release}
Provides: 2to3 = %{version}-%{release}
Provides: idle3 = %{version}-%{release} Provides: idle3 = %{version}-%{release}
# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 Provides: %{name}-tools = %{version}-%{release}
# /usr/bin/2to3 was moved from here Provides: %{name}-tools%{?_isa} = %{version}-%{release}
# TODO Remove in Fedora 29 Obsoletes: %{name}-tools < %{version}-%{release}
Conflicts: python2-tools < 2.7.13-17
Conflicts: python-tools < 2.7.13-17
# Shall be removed in Fedora 31 # Shall be removed in Fedora 31
Obsoletes: platform-python-tools < %{platpyver} Obsoletes: platform-python-tools < %{platpyver}
%description tools %description idle
This package contains several tools included with Python, including: IDLE is Pythons Integrated Development and Learning Environment.
- 2to3, an automatic source converter from Python 2.X
- idle, a basic graphical development environment IDLE has the following features: Python shell window (interactive
interpreter) with colorizing of code input, output, and error messages;
multi-window text editor with multiple undo, Python colorizing,
smart indent, call tips, auto completion, and other features;
search within any window, replace within editor windows, and
search through multiple files (grep); debugger with persistent
breakpoints, stepping, and viewing of global and local namespaces;
configuration, browsers, and other dialogs.
%package tkinter %package tkinter
@ -558,7 +574,6 @@ the Python programming language.
%package test %package test
Summary: The self-test suite for the main python3 package Summary: The self-test suite for the main python3 package
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: %{name}-tools = %{version}-%{release}
# Shall be removed in Fedora 31 # Shall be removed in Fedora 31
Obsoletes: platform-python-test < %{platpyver} Obsoletes: platform-python-test < %{platpyver}
@ -583,7 +598,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-test%{?_isa} = %{version}-%{release} Requires: %{name}-test%{?_isa} = %{version}-%{release}
Requires: %{name}-tkinter%{?_isa} = %{version}-%{release} Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}
Requires: %{name}-tools%{?_isa} = %{version}-%{release} Requires: %{name}-idle%{?_isa} = %{version}-%{release}
%description debug %description debug
python3-debug provides a version of the Python runtime with numerous debugging python3-debug provides a version of the Python runtime with numerous debugging
@ -891,21 +906,6 @@ mkdir -p %{buildroot}%{_datadir}/appdata
cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml
# Development tools
install -m755 -d %{buildroot}%{pylibdir}/Tools
install Tools/README %{buildroot}%{pylibdir}/Tools/
cp -ar Tools/freeze %{buildroot}%{pylibdir}/Tools/
cp -ar Tools/i18n %{buildroot}%{pylibdir}/Tools/
cp -ar Tools/pynche %{buildroot}%{pylibdir}/Tools/
cp -ar Tools/scripts %{buildroot}%{pylibdir}/Tools/
# Documentation tools
install -m755 -d %{buildroot}%{pylibdir}/Doc
cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/
# Demo scripts
cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/
# Make sure distutils looks at the right pyconfig.h file # Make sure distutils looks at the right pyconfig.h file
# See https://bugzilla.redhat.com/show_bug.cgi?id=201434 # See https://bugzilla.redhat.com/show_bug.cgi?id=201434
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
@ -918,22 +918,21 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
%{buildroot}%{pylibdir}/distutils/sysconfig.py \ %{buildroot}%{pylibdir}/distutils/sysconfig.py \
%{buildroot}%{pylibdir}/sysconfig.py %{buildroot}%{pylibdir}/sysconfig.py
# Install pathfix.py to bindir
# See https://github.com/fedora-python/python-rpm-porting/issues/24
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
# Switch all shebangs to refer to the specific Python version. # Switch all shebangs to refer to the specific Python version.
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
# so handle files named using other naming scheme separately. # so handle files named using other naming scheme separately.
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
Tools/scripts/pathfix.py \ Tools/scripts/pathfix.py \
-i "%{_bindir}/python%{pybasever}" \ -i "%{_bindir}/python%{pybasever}" \
%{buildroot} %{buildroot}%{pylibdir}/Tools/scripts/*-*.py \ %{buildroot}
%{buildroot}%{pylibdir}/Tools/pynche/{pynche,pynche.pyw}
# not covered, also redundant and useless:
rm %{buildroot}%{pylibdir}/Tools/scripts/{2to3,idle3,pydoc3,pyvenv}
# Move pathfix.py to bindir
# See https://github.com/fedora-python/python-rpm-porting/issues/24
mv %{buildroot}%{pylibdir}/Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
# Remove tests for python3-tools which was removed in
# https://bugzilla.redhat.com/show_bug.cgi?id=1312030
rm -rf %{buildroot}%{pylibdir}/test/test_tools
# Remove shebang lines from .py files that aren't executable, and # Remove shebang lines from .py files that aren't executable, and
# remove executability from .py files that don't have a shebang line: # remove executability from .py files that don't have a shebang line:
@ -943,10 +942,6 @@ find %{buildroot} -name \*.py \
-perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
-exec chmod a-x {} \; \) \) -exec chmod a-x {} \; \) \)
# Remove executable flag from files that shouldn't have it:
chmod a-x \
%{buildroot}%{pylibdir}/Tools/README
# Get rid of DOS batch files: # Get rid of DOS batch files:
find %{buildroot} -name \*.bat -exec rm {} \; find %{buildroot} -name \*.bat -exec rm {} \;
@ -1134,8 +1129,6 @@ CheckPython optimized
%{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} %{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes}
%endif %endif
%{pylibdir}/idlelib
%dir %{pylibdir}/test/ %dir %{pylibdir}/test/
%dir %{pylibdir}/test/__pycache__/ %dir %{pylibdir}/test/__pycache__/
%dir %{pylibdir}/test/support/ %dir %{pylibdir}/test/support/
@ -1311,6 +1304,9 @@ CheckPython optimized
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/2to3
# TODO: Remove 2to3-3.7 once rebased to 3.7
%{_bindir}/2to3-%{pybasever}
%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/*
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
%{pylibdir}/distutils/command/wininst-*.exe %{pylibdir}/distutils/command/wininst-*.exe
@ -1329,14 +1325,10 @@ CheckPython optimized
%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever}
%{_rpmconfigdir}/macros.d/macros.systempython %{_rpmconfigdir}/macros.d/macros.systempython
%files tools %files idle
%defattr(-,root,root,755) %defattr(-,root,root,755)
%{_bindir}/2to3
# TODO: Remove 2to3-3.7 once rebased to 3.7
%{_bindir}/2to3-%{pybasever}
%{_bindir}/idle* %{_bindir}/idle*
%{pylibdir}/Tools %{pylibdir}/idlelib
%doc %{pylibdir}/Doc
%{_datadir}/appdata/idle3.appdata.xml %{_datadir}/appdata/idle3.appdata.xml
%{_datadir}/applications/idle3.desktop %{_datadir}/applications/idle3.desktop
%{_datadir}/icons/hicolor/*/apps/idle3.* %{_datadir}/icons/hicolor/*/apps/idle3.*
@ -1502,6 +1494,12 @@ CheckPython optimized
# ====================================================== # ======================================================
%changelog %changelog
* Thu Feb 15 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.6.4-14
- Remove the python3-tools package (#rhbz 1312030)
- Move /usr/bin/2to3 to python3-devel
- Move /usr/bin/idle and idlelib to python3-idle
- Provide python3-tools from python3-idle
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6.4-13 * Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6.4-13
- Escape macros in %%changelog - Escape macros in %%changelog