#4 Remove the python3-tools package (bz#1312030)
Closed 7 years ago by churchyard. Opened 7 years ago by ishcherb.
rpms/ ishcherb/python37 no-tools  into  master

file modified
+55 -55
@@ -18,7 +18,7 @@ 

  #  WARNING  When rebasing to a new Python version,

  #           remember to update the python3-docs package as well

  Version: %{pybasever}.0

- Release: 0.4.%{?prerel}%{?dist}

+ Release: 0.5.%{?prerel}%{?dist}

  License: Python

  

  
@@ -519,8 +519,21 @@ 

  # TODO change to a specific subpackage once available (#1218294)

  Requires: redhat-rpm-config

  

+ Provides: %{name}-2to3 = %{version}-%{release}

+ Provides: 2to3 = %{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.7

+ 

  # Shall be removed in Fedora 31

  Obsoletes: platform-python-devel < %{platpyver}

  
@@ -529,32 +542,35 @@ 

  Python extension modules (typically written in C or C++), to embed Python

  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

- Summary: A collection of tools included with Python including 2to3 and idle

+ %package idle

+ Summary: A basic graphical development environment for Python

  Requires: %{name} = %{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}

  

- # https://bugzilla.redhat.com/show_bug.cgi?id=1111275

- # /usr/bin/2to3 was moved from here

- # TODO Remove in Fedora 29

- Conflicts: python2-tools < 2.7.13-17

- Conflicts: python-tools < 2.7.13-17

+ Provides: %{name}-tools = %{version}-%{release}

+ Provides: %{name}-tools%{?_isa} = %{version}-%{release}

+ Obsoletes: %{name}-tools < %{version}-%{release}

  

  # Shall be removed in Fedora 31

  Obsoletes: platform-python-tools < %{platpyver}

  

- %description tools

- This package contains several tools included with Python, including:

- - 2to3, an automatic source converter from Python 2.X

- - idle, a basic graphical development environment

+ %description idle

+ IDLE is Python’s Integrated Development and Learning 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
@@ -572,7 +588,6 @@ 

  %package test

  Summary: The self-test suite for the main python3 package

  Requires: %{name} = %{version}-%{release}

- Requires: %{name}-tools = %{version}-%{release}

  

  # Shall be removed in Fedora 31

  Obsoletes: platform-python-test < %{platpyver}
@@ -597,7 +612,7 @@ 

  Requires: %{name}-devel%{?_isa} = %{version}-%{release}

  Requires: %{name}-test%{?_isa} = %{version}-%{release}

  Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}

- Requires: %{name}-tools%{?_isa} = %{version}-%{release}

+ Requires: %{name}-idle%{?_isa} = %{version}-%{release}

  

  %description debug

  python3-debug provides a version of the Python runtime with numerous debugging
@@ -944,21 +959,6 @@ 

  appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml

  %endif

  

- # 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

  # See https://bugzilla.redhat.com/show_bug.cgi?id=201434

  # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
@@ -971,22 +971,21 @@ 

    %{buildroot}%{pylibdir}/distutils/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.

  # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,

  # so handle files named using other naming scheme separately.

  LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \

    Tools/scripts/pathfix.py \

    -i "%{_bindir}/python%{pybasever}" \

-   %{buildroot} %{buildroot}%{pylibdir}/Tools/scripts/*-*.py \

-   %{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}/

+   %{buildroot}

  

+ # 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 executability from .py files that don't have a shebang line:
@@ -996,10 +995,6 @@ 

    -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \

    -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:

  find %{buildroot} -name \*.bat -exec rm {} \;

  
@@ -1047,9 +1042,10 @@ 

  ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python

  %endif

  

- # There's no point of having this, as decided in

- # https://bugzilla.redhat.com/show_bug.cgi?id=1111275

- rm %{buildroot}%{_bindir}/2to3-%{pybasever}

+ # There's 2to3-X.X executable and 2to3 soft link to it.

+ # No reason to have both, so keep only 2to3 as an executable.

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=1111275

+ mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3

  

  %if %{with flatpackage}

  # Remove stuff that would conflict with python3 package
@@ -1267,8 +1263,6 @@ 

  %{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes}

  %endif

  

- %{pylibdir}/idlelib

- 

  %dir %{pylibdir}/test/

  %dir %{pylibdir}/test/__pycache__/

  %dir %{pylibdir}/test/support/
@@ -1458,6 +1452,7 @@ 

  %if %{without flatpackage}

  %files devel

  %defattr(-,root,root)

+ %{_bindir}/2to3

  %endif

  

  %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/*
@@ -1486,17 +1481,16 @@ 

  

  

  %if %{without flatpackage}

- %files tools

+ %files idle

  %defattr(-,root,root,755)

  

- %{_bindir}/2to3

  %{_bindir}/idle*

  %else

  %{_bindir}/idle%{pybasever}

  %endif

  

- %{pylibdir}/Tools

- %doc %{pylibdir}/Doc

+ %{pylibdir}/idlelib

+ 

  %if %{without flatpackage}

  %{_datadir}/appdata/idle3.appdata.xml

  %{_datadir}/applications/idle3.desktop
@@ -1684,6 +1678,12 @@ 

  # ======================================================

  

  %changelog

+ * Fri Jan 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.7.0-0.5.a4

+ - 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

+ 

  * Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 3.7.0-0.4.a4

  - Rebuilt for switch to libxcrypt

  

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

Scope:

  • Remove the python3-tools package together with Tools/ library
  • Move /usr/bin/2to3 to python3-devel and provide 2to3 and pythonX-2to3
  • Move /usr/bin/idle and idlelib to a sepatarte python3-idle subpackage
  • Provide python3-tools from python3-idle
  • Remove tests for tools and requirement for python3-tools from python3-tests package as they are testing scripts from Tools/ which were removed

this should now be part of python3-devel. it should also conflict with python3-tools < (hardcoded current version)

something still needs to obsolete this. maybe just the python3 packages, maybe devel, that's not that important.

or even idle for consistency

This needs more love. What about:

IDLE is Python’s Integrated Development and Learning 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.

(From https://docs.python.org/3/library/idle.html)

1 new commit added

  • fixup! Remove the python3-tools package (bz#1312030)
7 years ago

Thanks for the review! I have fixed the above comments in the last commit.

it should also conflict with python3-tools < (hardcoded current version)

So when the conflict usually should be removed? in around 3 releases?

So when the conflict usually should be removed? in around 3 releases?

Assuming this will get into Fedora 28 but not 27. N+2 upgrades are supported, so when users upgrade form F27 to F29 they need the conflict. It's safe to remove it once F30 is branched.

Assuming this will get into Fedora 28 but not 27. N+2 upgrades are supported, so when users upgrade form F27 to F29 they need the conflict. It's safe to remove it once F30 is branched.

Thanks for explanation. Will add a todo comment

1 new commit added

  • fixup! Remove the python3-tools package (bz#1312030)
7 years ago

rebased onto ce693fbbdd4bab09005651c01fd3e9d2a2326175

7 years ago

Some sanity checks failed...

$ rpm -qpl python37-idle-3.7.0-0.4.a4.fc28.x86_64.rpm 
...
/usr/lib64/python3.7/idlelib/CREDITS.txt
/usr/lib64/python3.7/idlelib/ChangeLog
/usr/lib64/python3.7/idlelib/HISTORY.txt
/usr/lib64/python3.7/idlelib/NEWS.txt
/usr/lib64/python3.7/idlelib/NEWS2x.txt
/usr/lib64/python3.7/idlelib/README.txt
/usr/lib64/python3.7/idlelib/TODO.txt

Shouldn't those go into idle's %doc? With NEWS2x.txt completely removed (it's about python 2.7). (This is just a question, not a blocker, but while we are moving things around...) (Note: check if those are not loaded on runtime before moving it into doc.)


$ rpm -qp --requires python37-idle-3.7.0-0.4.a4.fc28.x86_64.rpm | grep -v rpmlib
/usr/bin/python3.7
python37 = 3.7.0-0.4.a4.fc28
python37-tkinter = 3.7.0-0.4.a4.fc28

$ rpm -qp --obsoletes python37-idle-3.7.0-0.4.a4.fc28.x86_64.rpm 
platform-python-tools < 3.6.2-20
python37-tools < 3.7.0-0.4.a4.fc28

$ rpm -qp --provides python37-idle-3.7.0-0.4.a4.fc28.x86_64.rpm 
application()
application(idle3.desktop)
idle3 = 3.7.0-0.4.a4.fc28
metainfo()
metainfo(idle3.appdata.xml)
mimehandler(text/x-python)
python37-idle = 3.7.0-0.4.a4.fc28
python37-idle(x86-64) = 3.7.0-0.4.a4.fc28
python37-tools = 3.7.0-0.4.a4.fc28
python37-tools(x86-64) = 3.7.0-0.4.a4.fc28

OK.


$ rpm -qpvl python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | grep 2to3
lrwxrwxrwx    1 root    root                        8 Jan 19 19:12 /usr/bin/2to3 -> 2to3-3.7

Not OK (it's a link to a file that is not there; instead of removing 2to3-3.7, is should be renamed to 2to3). (This was probably already broken, but should be fixed.)


$ rpm -qp --requires python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | grep -v rpmlib
/bin/sh
/usr/bin/env
/usr/bin/pkg-config
/usr/bin/python3.7m
libpython3.7m.so.1.0()(64bit)
python-rpm-macros
python3-rpm-generators
python3-rpm-macros
python37 = 3.7.0-0.4.a4.fc28
python37-libs(x86-64) = 3.7.0-0.4.a4.fc28
redhat-rpm-config

$ rpm2cpio python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | cpio -idmv
...

$ grep -r 'env python' usr
usr/bin/pathfix.py:#!/usr/bin/env python3

Not OK. This is broken by removing %{buildroot}%{pylibdir}/Tools/scripts/*-*.py from the pathfix call.
You can play around with the order and add already copied %{buildroot}%{_bindir}/pathfix.py as an argument of the pathfix call (or don't, because it should be pulled automatically with the %{buildroot} arg, but better be explicit).


$ rpm -qp --conflicts python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm 
python-tools < 2.7.13-17
python2-tools < 2.7.13-17
python3-tools < 3.7.0-0.4.a4
python37 < 3.7.0-0.4.a4.fc28

I think that the exact version for python3-tools conflict here doesn't make much sense.
If we decide to backport this to python3 3.6, it will have to be adjusted there.
For flatpackage python37 it doesn't happen, for non-flat python3 3.7 this will only make sense once 3.7 hits rawhide and that would be later than alpha versions, so I'll be less specific here and say < 3.7.


$ rpm -qp --provides python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | grep 2to3
2to3 = 3.7.0-0.4.a4.fc28
python37-2to3 = 3.7.0-0.4.a4.fc28

OK.

rebased onto 808e143

7 years ago

Shouldn't those go into idle's %doc? With NEWS2x.txt completely removed (it's about python 2.7). (This is just a question, not a blocker, but while we are moving things around...) (Note: check if those are not loaded on runtime before moving it into doc.)

Most of those files are indeed loaded on runtime for idle Help/About. More info here: https://github.com/python/cpython/blob/master/Lib/idlelib/README.txt#L95

I believe to doc we can move only HISTORY.txt, TODO.txt, extend.txt. Do you think it is worth it?


$ rpm -qpvl python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | grep 2to3 lrwxrwxrwx 1 root root 8 Jan 19 19:12 /usr/bin/2to3 -> 2to3-3.7

Not OK (it's a link to a file that is not there; instead of removing 2to3-3.7, is should be renamed to 2to3). (This was probably already broken, but should be fixed.)

Changed, fixup


$ rpm -qp --requires python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm | grep -v rpmlib /bin/sh /usr/bin/env

Not OK. This is broken by removing %{buildroot}%{pylibdir}/Tools/scripts/-.py from the pathfix call.
You can play around with the order and add already copied %{buildroot}%{_bindir}/pathfix.py as an argument of the pathfix call (or don't, because it should be pulled automatically with the %{buildroot} arg, but better be explicit).

I moved the pathfix.py installation before the pathfix call on %{buildroot}. I do not think we should add another explicit argument to pathfix.py, because then %{buildroot}%{_bindir}/pathfix.py will be converted twice, with no change message the second time. I know it's just one extra call with no harm, but it seems wrong.

fixup


$ rpm -qp --conflicts python37-devel-3.7.0-0.4.a4.fc28.x86_64.rpm
python3-tools < 3.7.0-0.4.a4

I think that the exact version for python3-tools conflict here doesn't make much sense.
If we decide to backport this to python3 3.6, it will have to be adjusted there.
For flatpackage python37 it doesn't happen, for non-flat python3 3.7 this will only make sense once 3.7 hits rawhide and that would be later than alpha versions, so I'll be less specific here and say < 3.7.

Right, changed to Conflicts: python3-tools < 3.7, fixup


Building a non flat package: https://koji.fedoraproject.org/koji/taskinfo?taskID=24471107

Note, to do a build I had to apply the latest commits from python3 package, otherwise python37 currently fails to build.
I have ported the commits in my branch here: https://src.fedoraproject.org/fork/ishcherb/rpms/python37/commits/sync-with-python3
I can do a separate PR from that branch if needed.

# There's no point of having this, as decided in
# https://bugzilla.redhat.com/show_bug.cgi?id=1111275
mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3

This needs to be reworded a bit, the comment is confusing.

I'll do sanity checks later.

Note, to do a build I had to apply the latest commits from python3 package, otherwise python37 currently fails to build.
I have ported the commits in my branch here: https://src.fedoraproject.org/fork/ishcherb/rpms/python37/commits/sync-with-python3
I can do a separate PR from that branch if needed.

@cstratak beware of that part not to duplicate this.

1 new commit added

  • fixup! Remove the python3-tools package (bz#1312030)
7 years ago

I believe to doc we can move only HISTORY.txt, TODO.txt, extend.txt. Do you think it is worth it?

Probably not.

$ rpm -qpvl python37-devel-3.7.0-0.7.a4.fc28.x86_64.rpm | grep 2to3
-rwxr-xr-x    1 root    root                       95 led 26 18:32 /usr/bin/2to3

$ rpm -qp --requires python37-devel-3.7.0-0.7.a4.fc28.x86_64.rpm | grep -v rpmlib
/bin/sh
/usr/bin/pkg-config
/usr/bin/python3.7
/usr/bin/python3.7m
libpython3.7m.so.1.0()(64bit)
python-rpm-macros
python3-rpm-generators
python3-rpm-macros
python37 = 3.7.0-0.7.a4.fc28
python37-libs(x86-64) = 3.7.0-0.7.a4.fc28
redhat-rpm-config

$ rpm -qp --conflicts python37-devel-3.7.0-0.7.a4.fc28.x86_64.rpm 
python-tools < 2.7.13-17
python2-tools < 2.7.13-17
python3-tools < 3.7
python37 < 3.7.0-0.7.a4.fc28

Pull-Request has been closed by churchyard

7 years ago