Hello community, here is the log from the commit of package python3 for openSUSE:Factory checked in at 2017-02-19 00:45:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3 (Old) and /work/SRC/openSUSE:Factory/.python3.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3" Changes: -------- --- /work/SRC/openSUSE:Factory/python3/python3-base.changes 2016-05-02 10:43:49.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3.new/python3-base.changes 2017-02-19 00:45:06.082069556 +0100 @@ -1,0 +2,48 @@ +Wed Feb 8 12:30:20 UTC 2017 - jmate...@suse.com + +- reenable test_socket with AEAD patch (test-socket-aead-kernel49.patch) +- reintroduce %py3_soflags macro (and better named %cpython3_soabi equivalent) + +------------------------------------------------------------------- +Wed Jan 11 14:57:07 UTC 2017 - jmate...@suse.com + +- update to 3.6.0 + * PEP 498 Formated string literals + * PEP 515 Underscores in numeric literals + * PEP 526 Syntax for variable annotations + * PEP 525 Asynchronous generators + * PEP 530 Asynchronous comprehensions + * PEP 506 New "secrets" module for safe key generation + * less memory consumed by dicts + * dtrace and systemtap support + * improved asyncio module + * better defaults for ssl + * new hashing algorithms in hashlib + * bytecode format changed to allow more optimizations + * "async" and "await" are on track to be reserved words + * StopIteration from generators is deprecated + * support for openssl < 1.0.2 is deprecated + * os.urandom now blocks when getrandom() blocks + * huge number of new features, bugfixes and optimizations + * see https://docs.python.org/3.6/whatsnew/3.6.html for details +- rework multilib patch: drop Python-3.5.0-multilib.patch, implement + upstreamable python-3.6.0-multilib-new.patch +- refresh python-3.3.0b1-localpath.patch, subprocess-raise-timeout.patch +- drop upstreamed Python-3.5.1-fix_lru_cache_copying.patch +- finally drop python-2.6b1-canonicalize2.patch that was not applied in source + and only kept around in case we needed it in the future. (which we don't, as it seems) +- update import_failed map and baselibs +- build ctypes against system libffi + (buildrequire libffi-devel in python3-base) +- add new key to keyring (signed by keys already in keyring) +- introduced common configure section between python3 and python3-base +- moved pyconfig.h and Makefile to devel subpackage as distutils no longer + need it at runtime +- added python-rpm-macros dependency, regenerated macros file, drop macros.python3.py + because it is not used now +- improve summaries and descriptions (fixes bsc#917607) +- enabled Link-Time Optimization, see what happens +- including skipped_tests.py in pre_checkin.sh run +- run specs through spec-cleaner, rearrange sections + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/python3/python3-doc.changes 2016-03-14 09:57:02.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3.new/python3-doc.changes 2017-02-19 00:45:06.130062802 +0100 @@ -1,0 +2,7 @@ +Mon Jan 16 14:20:51 UTC 2017 - jmate...@suse.com + +- update to 3.6.0 + * see python3-base.changes for details +- run spec through spec-cleaner, rearrange sections + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/python3/python3.changes 2016-05-02 10:43:49.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3.new/python3.changes 2017-02-19 00:45:06.210051545 +0100 @@ -1,0 +2,36 @@ +Wed Jan 11 14:57:07 UTC 2017 - jmate...@suse.com + +- update to 3.6.0 + * PEP 498 Formated string literals + * PEP 515 Underscores in numeric literals + * PEP 526 Syntax for variable annotations + * PEP 525 Asynchronous generators + * PEP 530 Asynchronous comprehensions + * PEP 506 New "secrets" module for safe key generation + * less memory consumed by dicts + * dtrace and systemtap support + * improved asyncio module + * better defaults for ssl + * new hashing algorithms in hashlib + * bytecode format changed to allow more optimizations + * "async" and "await" are on track to be reserved words + * StopIteration from generators is deprecated + * support for openssl < 1.0.2 is deprecated + * os.urandom now blocks when getrandom() blocks + * huge number of new features, bugfixes and optimizations + * see https://docs.python.org/3.6/whatsnew/3.6.html for details +- rework multilib patch: drop Python-3.5.0-multilib.patch, implement + upstreamable python-3.6.0-multilib-new.patch +- refresh python-3.3.0b1-localpath.patch, subprocess-raise-timeout.patch +- drop upstreamed Python-3.5.1-fix_lru_cache_copying.patch +- finally drop python-2.6b1-canonicalize2.patch that was not applied in source + and only kept around in case we needed it in the future. (which we don't, as it seems) +- update import_failed map and baselibs +- improve summaries and descriptions (fixes bsc#917607) +- add new key to keyring (signed by keys already in keyring) +- introduced common configure section between python3 and python3-base +- do not disable ASNEEDED +- remove baselibs/rpmlint as sources from python.spec, only keep in base.spec +- run spec through spec-cleaner, rearrange sections + +------------------------------------------------------------------- Old: ---- Python-3.5.0-multilib.patch Python-3.5.1-fix_lru_cache_copying.patch Python-3.5.1.tar.xz Python-3.5.1.tar.xz.asc macros.python3.py python-2.6b1-canonicalize2.patch New: ---- Python-3.6.0.tar.xz Python-3.6.0.tar.xz.asc macros.python3 python-3.6.0-multilib-new.patch skipped_tests.py test-socket-aead-kernel49.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-base.spec ++++++ ++++ 630 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/python3/python3-base.spec ++++ and /work/SRC/openSUSE:Factory/.python3.new/python3-base.spec ++++++ python3-doc.spec ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.345750990 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.349750427 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-doc # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,69 +16,24 @@ # -Name: python3-doc -Url: http://www.python.org/ -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: xz -Summary: Additional Package Documentation for Python 3 -License: Python-2.0 -Group: Development/Languages/Python -Version: 3.5.1 -Release: 0 -BuildArch: noarch +### COMMON-DEF-BEGIN ### %define tarversion %{version} %define tarname Python-%{tarversion} -Source0: http://www.python.org/ftp/python/%{tarversion}/%{tarname}.tar.xz -BuildRequires: libqt5-qttools -BuildRequires: python-Sphinx >= 1.2 - -# for consistency: -### COMMON-PATCH-BEGIN ### - -# implement "--record-rpm" option for distutils installations -Patch01: Python-3.0b1-record-rpm.patch -# support lib-vs-lib64 distinction -Patch02: Python-3.5.0-multilib.patch -# securing usage of readlink/realpath in PySys_SetArgv -Patch03: python-2.6b1-canonicalize2.patch -# support finding packages in /usr/local, install to /usr/local by default -Patch04: python-3.3.0b1-localpath.patch -# replace DATE, TIME and COMPILER by fixed definitions to aid reproducible builds -Patch06: python-3.3.0b1-fix_date_time_compiler.patch -# fix wrong include path in curses-panel module -Patch07: python-3.3.0b1-curses-panel.patch -# POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test -Patch09: python-3.3.0b1-test-posix_fadvise.patch -# Disable global and distutils sysconfig comparison test, we deviate from the default depending on optflags -Patch12: python-3.3.3-skip-distutils-test_sysconfig_module.patch -# Raise timeout value for test_subprocess -Patch15: subprocess-raise-timeout.patch -# PATCH-FIX-UPSTREAM Fix argument passing in libffi for aarch64 -Patch19: python-2.7-libffi-aarch64.patch -# PATCH-FIX-UPSTREAM python3-ncurses-6.0-accessors.patch dims...@opensuse.org -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 -Patch20: python3-ncurses-6.0-accessors.patch -# PATCH-FIX-UPSTREAM Python-3.5.1-fix_lru_cache_copying.patch -- Fix copying the lru_cache() wrapper object -- https://bugs.python.org/issue25447 -Patch30: Python-3.5.1-fix_lru_cache_copying.patch -### COMMON-PATCH-END ### -### COMMON-DEF-BEGIN ### - # the versions are autogenerated from pre_checkin.sh # based on the current source tarball -%define python_version 3.5 - -%define python_version_abitag 35 -%define python_version_soname 3_5 +%define python_version 3.6 +%define python_version_abitag 36 +%define python_version_soname 3_6 %define sitedir %{_libdir}/python%{python_version} -# three possible ABI kinds: m - pymalloc, d - debug build -# see PEP 3149 +# three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149 %define abi_kind m # python ABI version - used in some file names %define python_abi %{python_version}%{abi_kind} # soname ABI tag defined in PEP 3149 %define abi_tag %{python_version_abitag}%{abi_kind} - +# version part of "libpython" package %define so_version %{python_version_soname}%{abi_kind}1_0 # rpm and python have different ideas about what is an arch-dependent name, so: @@ -97,25 +52,58 @@ # pyexpat.cpython-35m-armv7-linux-gnueabihf %define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so ### COMMON-DEF-END ### - +# +Name: python3-doc +Version: 3.6.0 +Release: 0 +Summary: Additional Package Documentation for Python 3 +License: Python-2.0 +Group: Development/Languages/Python +Url: http://www.python.org/ +Source0: http://www.python.org/ftp/python/%{tarversion}/%{tarname}.tar.xz +BuildRequires: libqt5-qttools +BuildRequires: python-Sphinx >= 1.2 +BuildRequires: xz Enhances: python3 = %{python_version} +BuildArch: noarch +# for consistency: +### COMMON-PATCH-BEGIN ### +# implement "--record-rpm" option for distutils installations +Patch01: Python-3.0b1-record-rpm.patch +# support lib-vs-lib64 distinction +Patch02: python-3.6.0-multilib-new.patch +# support finding packages in /usr/local, install to /usr/local by default +Patch04: python-3.3.0b1-localpath.patch +# replace DATE, TIME and COMPILER by fixed definitions to aid reproducible builds +Patch06: python-3.3.0b1-fix_date_time_compiler.patch +# fix wrong include path in curses-panel module +Patch07: python-3.3.0b1-curses-panel.patch +# POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test +Patch09: python-3.3.0b1-test-posix_fadvise.patch +# Disable global and distutils sysconfig comparison test, we deviate from the default depending on optflags +Patch12: python-3.3.3-skip-distutils-test_sysconfig_module.patch +# Raise timeout value for test_subprocess +Patch15: subprocess-raise-timeout.patch +# PATCH-FIX-UPSTREAM Fix argument passing in libffi for aarch64 +Patch19: python-2.7-libffi-aarch64.patch +# PATCH-FIX-UPSTREAM python3-ncurses-6.0-accessors.patch dims...@opensuse.org -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 +Patch20: python3-ncurses-6.0-accessors.patch +# PATCH-FIX-UPSTREAM fix Kernel Crypto test failing on kernel >= 4.9 +Patch21: test-socket-aead-kernel49.patch +### COMMON-PATCH-END ### %description Tutorial, Global Module Index, Language Reference, Library Reference, Extending and Embedding Reference, Python/C API Reference, Documenting Python, and Macintosh Module Reference in HTML format. - %prep %setup -q -n %{tarname} # for consistency ### COMMON-PREP-BEGIN ### - %patch01 -p1 %patch02 -p1 -#%%patch03 -#- canonicalize disabled, needs testing whether the exploit still works %patch04 %patch06 -p1 %patch07 @@ -124,7 +112,7 @@ %patch15 -p1 %patch19 -p1 %patch20 -p1 -%patch30 -p1 +%patch21 -p1 # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac @@ -132,26 +120,34 @@ # fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3 for dir in Lib Tools; do # find *.py, filter to files that contain bad shebangs + # break up "/""usr" like this to prevent replacing with %{_prefix} find $dir -name '*.py' -type f -print0 \ - | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' \ - | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!/usr/bin/python3@' + | xargs -0 grep -lE '^#! *(/''usr/.*bin/(env +)?)?python' \ + | xargs sed -r -i -e '1s@^#![[:space:]]*(/''usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!%{_bindir}/python3@' done +# drop in-tree libffi and expat +rm -r Modules/_ctypes/libffi +rm -r Modules/expat + +# drop duplicate README from site-packages +rm Lib/site-packages/README.txt + ### COMMON-PREP-END ### %build -TODAY_DATE=`date -r %{S:0} "+%B %d, %Y"` +TODAY_DATE=`date -r %{SOURCE0} "+%%B %%d, %%Y"` # TODO use not date of tarball but date of latest patch cd Doc sed -i "s/^today = .*/today = '$TODAY_DATE'/" conf.py -make html +make -j1 html # create a .qch file that can be used in QtAssistant or KDevelop sphinx-build -a -b qthelp . build/qthelp qhelpgenerator-qt5 build/qthelp/Python.qhp -o build/qthelp/Python.qch %install -export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/python3 +export PDOCS=%{buildroot}%{_docdir}/python3 mkdir -p $PDOCS # generated docs rm Doc/build/html/.buildinfo @@ -164,9 +160,6 @@ [ -f $i ] && install -c -m 644 $i $PDOCS/Misc/ done -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(644, root, root, 755) %dir %{_docdir}/python3 ++++++ python3.spec ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.377746487 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.381745925 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3 # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,57 @@ # +# do not add defs here, please edit python3-base.spec instead +# and run pre_checkin.sh +# +# see PACKAGING-NOTES for details +# +### COMMON-DEF-BEGIN ### +%define tarversion %{version} +%define tarname Python-%{tarversion} +# the versions are autogenerated from pre_checkin.sh +# based on the current source tarball +%define python_version 3.6 +%define python_version_abitag 36 +%define python_version_soname 3_6 + +%define sitedir %{_libdir}/python%{python_version} + +# three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149 +%define abi_kind m +# python ABI version - used in some file names +%define python_abi %{python_version}%{abi_kind} +# soname ABI tag defined in PEP 3149 +%define abi_tag %{python_version_abitag}%{abi_kind} +# version part of "libpython" package +%define so_version %{python_version_soname}%{abi_kind}1_0 + +# rpm and python have different ideas about what is an arch-dependent name, so: +%if %{__isa_name} == ppc +%define archname %(echo %{_arch} | sed s/ppc/powerpc/) +%else +%define archname %{_arch} +%endif +# our arm has Hardware-Floatingpoint +%if %{_arch} == arm +%define armsuffix hf +%endif + +# pyexpat.cpython-35m-x86_64-linux-gnu +# pyexpat.cpython-35m-powerpc64le-linux-gnu +# pyexpat.cpython-35m-armv7-linux-gnueabihf +%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so +### COMMON-DEF-END ### +# Name: python3 +Version: 3.6.0 +Release: 0 +Summary: Python 3 Interpreter +License: Python-2.0 +Group: Development/Languages/Python +Url: http://www.python.org/ +Source0: http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz +Source1: http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz.asc BuildRequires: automake BuildRequires: db-devel BuildRequires: fdupes @@ -30,47 +80,36 @@ BuildRequires: libffi-devel BuildRequires: lzma-devel BuildRequires: ncurses-devel +BuildRequires: netcfg BuildRequires: openssl-devel +BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel BuildRequires: tk-devel BuildRequires: xz BuildRequires: pkgconfig(x11) -Url: http://www.python.org/ -Summary: Python 3 Interpreter -License: Python-2.0 -Group: Development/Languages/Python -Version: 3.5.1 -Release: 0 -%define tarversion %{version} -%define tarname Python-%{tarversion} - Requires: python3-base = %{version} -Recommends: python3-pip Recommends: python3-curses Recommends: python3-dbm Recommends: python3-idle +Recommends: python3-pip Recommends: python3-tk - -Source0: http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz -Source1: baselibs.conf -Source2: python3-rpmlintrc -#Source11: testfiles.tar.bz2 -# issues with copyrighted Unicode testing files - +# some compatibility Provides +Provides: python = %{python_version} +Provides: python3 = %{python_version} +Provides: python3-xml = %{version} +Obsoletes: python3-xml < %{version} +# # do not add patches here, please edit python3-base.spec instead # and run pre_checkin.sh # # see PACKAGING-NOTES for details - +# ### COMMON-PATCH-BEGIN ### - # implement "--record-rpm" option for distutils installations Patch01: Python-3.0b1-record-rpm.patch # support lib-vs-lib64 distinction -Patch02: Python-3.5.0-multilib.patch -# securing usage of readlink/realpath in PySys_SetArgv -Patch03: python-2.6b1-canonicalize2.patch +Patch02: python-3.6.0-multilib-new.patch # support finding packages in /usr/local, install to /usr/local by default Patch04: python-3.3.0b1-localpath.patch # replace DATE, TIME and COMPILER by fixed definitions to aid reproducible builds @@ -87,116 +126,56 @@ Patch19: python-2.7-libffi-aarch64.patch # PATCH-FIX-UPSTREAM python3-ncurses-6.0-accessors.patch dims...@opensuse.org -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 Patch20: python3-ncurses-6.0-accessors.patch -# PATCH-FIX-UPSTREAM Python-3.5.1-fix_lru_cache_copying.patch -- Fix copying the lru_cache() wrapper object -- https://bugs.python.org/issue25447 -Patch30: Python-3.5.1-fix_lru_cache_copying.patch +# PATCH-FIX-UPSTREAM fix Kernel Crypto test failing on kernel >= 4.9 +Patch21: test-socket-aead-kernel49.patch ### COMMON-PATCH-END ### -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -# do not add defs here, please edit python3-base.spec instead -# and run pre_checkin.sh -# -# see PACKAGING-NOTES for details - -### COMMON-DEF-BEGIN ### - -# the versions are autogenerated from pre_checkin.sh -# based on the current source tarball -%define python_version 3.5 - -%define python_version_abitag 35 -%define python_version_soname 3_5 - -%define sitedir %{_libdir}/python%{python_version} - -# three possible ABI kinds: m - pymalloc, d - debug build -# see PEP 3149 -%define abi_kind m -# python ABI version - used in some file names -%define python_abi %{python_version}%{abi_kind} -# soname ABI tag defined in PEP 3149 -%define abi_tag %{python_version_abitag}%{abi_kind} - -%define so_version %{python_version_soname}%{abi_kind}1_0 - -# rpm and python have different ideas about what is an arch-dependent name, so: -%if %{__isa_name} == ppc -%define archname %(echo %{_arch} | sed s/ppc/powerpc/) -%else -%define archname %{_arch} -%endif -# our arm has Hardware-Floatingpoint -%if %{_arch} == arm -%define armsuffix hf -%endif - -# pyexpat.cpython-35m-x86_64-linux-gnu -# pyexpat.cpython-35m-powerpc64le-linux-gnu -# pyexpat.cpython-35m-armv7-linux-gnueabihf -%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so -### COMMON-DEF-END ### - -# some compatibility Provides -Provides: python = %{python_version} -Provides: python3 = %{python_version} - -Provides: python3-xml = %{version} -Obsoletes: python3-xml < %{version} - %description Python 3 is modern interpreted, object-oriented programming language, often compared to Tcl, Perl, Scheme, or Java. You can find an overview of Python in the documentation and tutorials included in the python-doc -(HTML) or python-doc-pdf (PDF) packages. - -If you want to install third party modules using distutils, you need to -install python3-devel package. - - - -Authors: --------- - Guido van Rossum <gu...@python.org> +package. +This package supplies rich command line features provided by readline, +XML processing tools, "ensurepip" installer, and sqlite3 support for +the interpreter core, thus forming a so called "extended" runtime. +Installing "python3" is sufficient for the vast majority of usecases. +In addition, recommended packages provide UI toolkit support (python3-curses, +python3-tk), legacy UNIX database bindings (python3-dbm), and the IDLE +development environment (python3-idle). %package tk -Requires: %{name} = %{version} Summary: TkInter - Python Tk Interface Group: Development/Libraries/Python +Requires: %{name} = %{version} %description tk Python interface to Tk. Tk is the GUI toolkit that comes with Tcl. The "xrpm" package uses this Python interface. - %package curses -Requires: %{name} = %{version} Summary: Python Interface to the (N)Curses Library Group: Development/Libraries/Python +Requires: %{name} = %{version} %description curses An easy to use interface to the (n)curses CUI library. CUI stands for Console User Interface. - %package dbm -Requires: %{name} = %{version} Summary: Python Interface to the GDBM Library Group: Development/Languages/Python +Requires: %{name} = %{version} %description dbm An easy to use interface for Unix DBM databases, and more specifically, the GNU implementation GDBM. - %prep %setup -q -n %{tarname} ### COMMON-PREP-BEGIN ### - %patch01 -p1 %patch02 -p1 -#%%patch03 -#- canonicalize disabled, needs testing whether the exploit still works %patch04 %patch06 -p1 %patch07 @@ -205,7 +184,7 @@ %patch15 -p1 %patch19 -p1 %patch20 -p1 -%patch30 -p1 +%patch21 -p1 # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac @@ -213,36 +192,52 @@ # fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3 for dir in Lib Tools; do # find *.py, filter to files that contain bad shebangs + # break up "/""usr" like this to prevent replacing with %{_prefix} find $dir -name '*.py' -type f -print0 \ - | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' \ - | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!/usr/bin/python3@' + | xargs -0 grep -lE '^#! *(/''usr/.*bin/(env +)?)?python' \ + | xargs sed -r -i -e '1s@^#![[:space:]]*(/''usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!%{_bindir}/python3@' done +# drop in-tree libffi and expat +rm -r Modules/_ctypes/libffi +rm -r Modules/expat + +# drop duplicate README from site-packages +rm Lib/site-packages/README.txt + ### COMMON-PREP-END ### %build -export SUSE_ASNEEDED=0 +### COMMON-CONFIG-BEGIN ### +# use rpm_opt_flags export OPT="%{optflags} -DOPENSSL_LOAD_CONF" -autoreconf -f -i . -# prevent make from trying to rebuild asdl stuff, which requires existing -# python installation -touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h Objects/typeslots.inc - -./configure \ - --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --mandir=%{_mandir} \ +touch -r %{SOURCE0} Makefile.pre.in + +autoreconf -fi +# prevent make from trying to rebuild asdl stuff, which requires existing python installation +touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h +# prevent makeopcodetargets +touch -r Python/opcode_targets.h Lib/opcode.py Python/makeopcodetargets.py + +%if 0%{?sles_version} +sed -e 's/-fprofile-correction//' -i Makefile.pre.in +%endif + +%configure \ --docdir=%{_docdir}/python \ --enable-ipv6 \ --with-fpectl \ --enable-shared \ + --with-ensurepip=no \ --with-system-ffi \ --with-system-expat \ - --with-ensurepip=no \ + --enable-lto \ --enable-loadable-sqlite-extensions -make %{?_smp_mflags} # DESTDIR=$RPM_BUILD_ROOT +### COMMON-CONFIG-END ### + +make %{?_smp_mflags} %check # Limit virtual memory to avoid spurious failures @@ -259,50 +254,56 @@ TESTS="$TESTS test_asyncio" %endif -make test TESTOPTS="-u curses $TESTS" +# XML tests +TESTS="$TESTS test_docxmlrpc test_minidom test_pulldom test_pyexpat \ + test_xml_etree test_xml_etree_c test_xmlrpc test_xmlrpc_net" +# XML-dependent tests +TESTS="$TESTS test_plistlib test_venv \ + test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn" + +make -j1 test TESTOPTS="-u curses $TESTS" %install make \ - OPT="%{optflags} -fPIC" \ - DESTDIR=$RPM_BUILD_ROOT \ + DESTDIR=%{buildroot} \ install # clean out stuff that is in python-base and subpackages -rm $RPM_BUILD_ROOT%{_bindir}/* -rm $RPM_BUILD_ROOT%{_libdir}/lib* -rm -r $RPM_BUILD_ROOT%{_libdir}/pkgconfig -rm -r $RPM_BUILD_ROOT%{_mandir}/* -rm -r $RPM_BUILD_ROOT%{_includedir}/* - -rm -r $RPM_BUILD_ROOT%{sitedir}/config* -find $RPM_BUILD_ROOT%{sitedir} -name "*.egg-info" -exec rm {} ";" -rm -r $RPM_BUILD_ROOT%{sitedir}/__pycache__ -rm -r $RPM_BUILD_ROOT%{sitedir}/site-packages -rm $RPM_BUILD_ROOT%{sitedir}/*.* +rm %{buildroot}%{_bindir}/* +rm %{buildroot}%{_libdir}/lib* +rm -r %{buildroot}%{_libdir}/pkgconfig +rm -r %{buildroot}%{_mandir}/* +rm -r %{buildroot}%{_includedir}/* + +rm -r %{buildroot}%{sitedir}/config* +find %{buildroot}%{sitedir} -name "*.egg-info" -exec rm {} ";" +rm -r %{buildroot}%{sitedir}/__pycache__ +rm -r %{buildroot}%{sitedir}/site-packages +rm %{buildroot}%{sitedir}/*.* for module in \ asyncio ctypes collections concurrent distutils email encodings \ html http \ - importlib json logging multiprocessing plat-* pydoc_data unittest \ + importlib json logging multiprocessing pydoc_data unittest \ urllib venv wsgiref lib2to3 test idlelib turtledemo do - rm -r $RPM_BUILD_ROOT%{sitedir}/$module + rm -r %{buildroot}%{sitedir}/$module done for library in \ - array audioop binascii _bisect _bz2 cmath _codecs_* _crypt _csv \ - _ctypes _datetime _decimal _elementtree fcntl grp _hashlib _heapq _json _lsprof \ + array _asyncio audioop binascii _bisect _bz2 cmath _codecs_* _crypt _csv \ + _ctypes _datetime _decimal fcntl grp _hashlib _heapq _json _lsprof \ _lzma math mmap _multibytecodec _multiprocessing nis _opcode ossaudiodev \ parser _pickle _posixsubprocess _random resource select _ssl _socket spwd \ _struct syslog termios _testbuffer _testimportmultiple _testmultiphase \ unicodedata zlib _ctypes_test _testcapi xxlimited \ - _md5 _sha1 _sha256 _sha512 + _md5 _sha1 _sha256 _sha512 _blake2 _sha3 do - eval rm "$RPM_BUILD_ROOT%{sitedir}/lib-dynload/$library.*" + eval rm "%{buildroot}%{sitedir}/lib-dynload/$library.*" done -%fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version} +%fdupes %{buildroot}/%{_libdir}/python%{python_version} %files tk %defattr(644, root, root, 755) @@ -331,6 +332,7 @@ %exclude %{sitedir}/sqlite3/test %{sitedir}/xml %{sitedir}/xmlrpc +%{dynlib _elementtree} %{dynlib pyexpat} %{dynlib readline} %{dynlib _sqlite3} ++++++ PACKAGING-NOTES ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.425739733 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.425739733 +0100 @@ -6,33 +6,37 @@ 1. the important stuff first -This is package "python3". However, master spec file for this package is "python3-base.spec". -That means that all important changes should be put into "python3-base.spec" and then submitted -against "python3" in OBS. +This is package "python3". However, master spec file for this package is +"python3-base.spec". That means that all important changes should be put into +"python3-base.spec" and then submitted against "python3" in OBS. -Changelogs of python3-base and python3 will be merged at some point. Now they arent, -but feel free to enter changes in either or both. +Changelogs of python3-base and python3 will be merged at some point. Now they +aren't, but feel free to enter changes in either or both. 2. why is that? -Technical reasons. python3-base was originally supposed to be a minimal package with no external -dependencies - so that it can build early in the distribution rebuild. There were also some -build loops involved. -Turns out, 90% of Python's standard library can be built without external dependencies. That's -what we do - in python3-base. python3 then only contains the remaining bits - dependency-heavy -subpackages, plus small bits depending on common packages (OpenSSL, expat, readline) -Logically, python3-base must be the master spec because it builds the important parts. +Technical reasons. python3-base was originally supposed to be a minimal package +with no external dependencies - so that it can build early in the distribution +rebuild. There were also some build loops involved. Turns out, 90% of Python's +standard library can be built without external dependencies. That's what we do - +in python3-base. python3 then only contains the remaining bits - +dependency-heavy subpackages, plus small bits depending on common packages +(OpenSSL, expat, readline) Logically, python3-base must be the master spec +because it builds the important parts. 3. why not rename the whole package to python3-base? Because that would be stupid. The package is called python3. -4. so why not make python3 the minimal package and put the rest in python3-the-rest? +4. so why not make python3 the minimal package and put the rest in +python3-the-rest? -Because other distributions use python3-base as the minimal package as well. Also, packages -that require python3 expect the whole deal, not a stripped-down version. +Because other distributions use python3-base as the minimal package as well. +Also, packages that require python3 expect the whole deal, not a stripped-down +version. -5. alright, let's build python3-base from python3.spec and python3 from someother.spec +5. alright, let's build python3-base from python3.spec and python3 from +someother.spec Tried that, abandoned it. It is more trouble than it's worth. @@ -40,19 +44,38 @@ II. pre_checkin.sh ------------------ -Our pre_checkin.sh takes care of copying relevant portions of python3-base.spec to python3.spec. -The "relevant portions" are: -* list of patches -* list of macro definitions -* patch apply sequence in %prep - -That means that when you're adding a patch, you need only add it to python3-base.spec and it will appear -magically in python3.spec too. - -If you want to replicate another section from py3-base to py3, just mark the section with -NEW-SECTION-BEGIN and NEW-SECTION-END (in both py3-base and py3) and add NEW-SECTION to list of $sections -in pre_checkin.sh - -pre_checkin.sh also finds the newest python tarball in the source directory and updates versions -in all specfiles to match it. Therefore, you usually don't need to update version numbers in specs -when you update Python +Our pre_checkin.sh takes care of copying relevant portions of python3-base.spec +to python3.spec. The "relevant portions" are: +* list of patches list of macro definitions patch apply sequence in %prep +* configure call and build setup for %build + +That means that when you're adding a patch, you need only add it to +python3-base.spec and it will appear magically in python3.spec too. (as long as +you remember to run pre_checkin.sh or have automation in place to do it for you) + +If you want to replicate another section from py3-base to py3, just mark the +section with NEW-SECTION-BEGIN and NEW-SECTION-END (in both py3-base and py3) +and add NEW-SECTION to list of $sections in pre_checkin.sh + +pre_checkin.sh also finds the newest python tarball in the source directory and +updates versions in all specfiles to match it. Therefore, you usually don't need +to update version numbers in specs when you update Python + +We also regenerate import_failed map and check test exclusion lists. + +III. import_failed.map +---------------------- + +This is a mechanism installed as part of python3-base, that places shim modules +on python's path (through a generated zzzz-import-failed-hooks.pth file, so that +it is imported as much at the end as makes sense; and an _import_failed subdir +of /usr/lib/pythonX.Y). Then when the user tries to import a module that is part +of a subpackage, the ImportError will contain a helpful message telling them +which missing subpackage to install. + +This can sometimes cause problems on non-standard configurations, if the pth +gets included too early (for instance if you are using a script to include all +pths by hand in some strange order). Just something to look out for. + +All this is based on information in import_failed.map, which is generated from +spec file filelists by pre_checkin.sh ++++++ Python-3.5.1.tar.xz -> Python-3.6.0.tar.xz ++++++ /work/SRC/openSUSE:Factory/python3/Python-3.5.1.tar.xz /work/SRC/openSUSE:Factory/.python3.new/Python-3.6.0.tar.xz differ: char 25, line 1 ++++++ baselibs.conf ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.497729603 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.501729039 +0100 @@ -1,3 +1,3 @@ python3 python3-base -libpython3_5m1_0 +libpython3_6m1_0 ++++++ import_failed.map ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.517726788 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.521726226 +0100 @@ -4,4 +4,4 @@ python3-tk: tkinter _tkinter python3-curses: curses _curses _curses_panel python3-dbm: dbm _dbm _gdbm -python3: ensurepip sqlite3 xml xmlrpc _hashlib pyexpat readline _sqlite3 _ssl +python3: ensurepip sqlite3 xml xmlrpc _elementtree pyexpat readline _sqlite3 ++++++ macros.python3.py -> macros.python3 ++++++ --- /work/SRC/openSUSE:Factory/python3/macros.python3.py 2014-10-31 12:30:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3.new/macros.python3 2017-02-19 00:45:05.874098824 +0100 @@ -1,33 +1,28 @@ -#!/usr/bin/python3 +%have_python3 1 -""" generate macros.python3 file from known values """ +# commented out legacy macro definitions +#py3_prefix /usr +#py3_incdir /usr/include/python3.5m +#py3_ver 3.5 -import sys,os -from sysconfig import get_path, get_config_var +# these should now be provided by macros.python_all +#python3_sitearch /usr/lib64/python3.5/site-packages +#python3_sitelib /usr/lib/python3.5/site-packages +#python3_version 3.5 -version = "{}.{}".format(*sys.version_info) -abiflags = get_config_var("ABIFLAGS") - -macros = { - "py3_ver": version, - "python3_version": version, - "py3_prefix": sys.prefix, -# hack-fix for bnc#787526 - get_path can't be used this way in python build dir -# "py3_incdir": get_path("include"), - "py3_incdir": "/usr/include/python" + version + abiflags, - "py3_abiflags": abiflags, - "py3_soflags": get_config_var("SOABI"), - "python3_sitelib": get_path("purelib"), - "python3_sitearch": get_path("platlib"), - "py3_compile(O)": """ -find %1 -name '*.pyc' -exec rm -f {} ";" -python3 -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 -%{-O: -find %1 -name '*.pyo' -exec rm -f {} ";" -python3 -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 -}""", +# hard to say if anyone ever used these? +#py3_soflags cpython-35m-x86_64-linux-gnu +#py3_abiflags m +%cpython3_soabi %(python3 -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))") +%py3_soflags %cpython3_soabi + +# compilation macros that might be in use somewhere +%py3_compile(O) \ +find %1 -name '*.pyc' -exec rm -f {} ";"\ +python3 -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1\ +%{-O:\ +find %1 -name '*.pyo' -exec rm -f {} ";"\ +python3 -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1\ } -for (macro,definition) in macros.items(): - definition = "\\\n".join(definition.split("\n")) - print( "%{} {}".format(macro, definition)) + ++++++ pre_checkin.sh ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.565720035 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.565720035 +0100 @@ -49,14 +49,18 @@ # copy definition sections -sections="COMMON-PATCH COMMON-DEF COMMON-PREP" +sections="DEF PATCH PREP CONFIG" for slave in python3.spec python3-doc.spec; do { prev=1 for section in $sections; do - begin="/$section-BEGIN/" - end="/$section-END/" + if ! grep -q "COMMON-$section" $slave; then + echo "Skipping $section for $slave" > /dev/stderr + continue + fi + begin="/COMMON-$section-BEGIN/" + end="/COMMON-$section-END/" sed -n -e "${prev},${begin}p" $slave sed -n -e "${begin},${end}p" $master | head -n -1 | tail -n +2 prev=$end @@ -102,6 +106,9 @@ package=$basename modules= ;; + "%{sitedir}/config-"*) + # ignore + ;; "%{sitedir}/"*) word=${line#"%{sitedir}/"} if ! echo $word | grep -q /; then @@ -119,3 +126,6 @@ done mv $MAPFILE.tmp $MAPFILE + +# run test inclusion check +python3 skipped_tests.py ++++++ python-3.3.0b1-localpath.patch ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.585717220 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.585717220 +0100 @@ -2,7 +2,7 @@ =================================================================== --- Lib/site.py.orig +++ Lib/site.py -@@ -74,7 +74,7 @@ import builtins +@@ -75,7 +75,7 @@ import builtins import _sitebuiltins # Prefixes for site-packages; add additional prefixes like /usr/local here @@ -11,30 +11,3 @@ # Enable per user site-packages directory # set it to False to disable the feature or True to force the feature ENABLE_USER_SITE = None -Index: Lib/test/test_site.py -=================================================================== ---- Lib/test/test_site.py.orig -+++ Lib/test/test_site.py -@@ -243,10 +243,19 @@ class HelperFunctionsTests(unittest.Test - self.assertEqual(dirs[1], wanted) - elif os.sep == '/': - # OS X non-framwework builds, Linux, FreeBSD, etc -- self.assertEqual(len(dirs), 1) -- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], -+ i = 0 -+ wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3], - 'site-packages') -- self.assertEqual(dirs[0], wanted) -+ self.assertEqual(dirs[i], wanted) -+ i += 1 -+ if sys.lib != 'lib': -+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], -+ 'site-packages') -+ self.assertEqual(dirs[i], wanted) -+ i += 1 -+ -+ self.assertTrue(i in (1,2)) -+ self.assertEqual(len(dirs), i) - else: - # other platforms - self.assertEqual(len(dirs), 2) ++++++ python-3.6.0-multilib-new.patch ++++++ Index: Python-3.6.0/configure.ac =================================================================== --- Python-3.6.0.orig/configure.ac +++ Python-3.6.0/configure.ac @@ -4598,12 +4598,26 @@ AC_MSG_CHECKING(LDVERSION) LDVERSION='$(VERSION)$(ABIFLAGS)' AC_MSG_RESULT($LDVERSION) +# platlibdir must be defined before LIBPL definition +AC_MSG_CHECKING(for custom platlibdir) +AC_ARG_WITH(custom-platlibdir, + [AS_HELP_STRING([--with-custom-platlibdir=<libdirname>], + [set the platlibdir name to a custom string])], + [], + [with_custom_platlibdir=yes]) +AS_CASE($with_custom_platlibdir, + [yes],[platlibdir=`basename ${libdir}`], + [no],[platlibdir=lib], + [platlibdir=$with_custom_platlibdir]) +AC_MSG_RESULT($platlibdir) +AC_SUBST(platlibdir) + dnl define LIBPL after ABIFLAGS and LDVERSION is defined. AC_SUBST(PY_ENABLE_SHARED) if test x$PLATFORM_TRIPLET = x; then - LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" + LIBPL='$(prefix)'"/${platlibdir}/python${VERSION}/config-${LDVERSION}" else - LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" + LIBPL='$(prefix)'"/${platlibdir}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" fi AC_SUBST(LIBPL) Index: Python-3.6.0/Makefile.pre.in =================================================================== --- Python-3.6.0.orig/Makefile.pre.in +++ Python-3.6.0/Makefile.pre.in @@ -125,13 +125,16 @@ exec_prefix= @exec_prefix@ # Install prefix for data files datarootdir= @datarootdir@ +# Name of "lib" directory under prefix +platlibdir= @platlibdir@ + # Expanded directories BINDIR= @bindir@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include -SCRIPTDIR= $(prefix)/lib +SCRIPTDIR= @libdir@ ABIFLAGS= @ABIFLAGS@ # Detailed destination directories @@ -751,6 +754,7 @@ Modules/getpath.o: $(srcdir)/Modules/get -DEXEC_PREFIX='"$(exec_prefix)"' \ -DVERSION='"$(VERSION)"' \ -DVPATH='"$(VPATH)"' \ + -DPLATLIBDIR='"$(platlibdir)"' \ -o $@ $(srcdir)/Modules/getpath.c Programs/python.o: $(srcdir)/Programs/python.c Index: Python-3.6.0/Modules/getpath.c =================================================================== --- Python-3.6.0.orig/Modules/getpath.c +++ Python-3.6.0/Modules/getpath.c @@ -51,9 +51,10 @@ * pybuilddir.txt. If the landmark is found, we're done. * * For the remaining steps, the prefix landmark will always be - * lib/python$VERSION/os.py and the exec_prefix will always be - * lib/python$VERSION/lib-dynload, where $VERSION is Python's version - * number as supplied by the Makefile. Note that this means that no more + * $lib/python$VERSION/os.py and the exec_prefix will always be + * $lib/python$VERSION/lib-dynload, where $VERSION is Python's version + * number and $lib is PLATLIBDIR as supplied by the Makefile. (usually + * "lib", "lib32" or "lib64"). Note that this means that no more * build directory checking is performed; if the first step did not find * the landmarks, the assumption is that python is running from an * installed setup. @@ -82,7 +83,7 @@ * containing the shared library modules is appended. The environment * variable $PYTHONPATH is inserted in front of it all. Finally, the * prefix and exec_prefix globals are tweaked so they reflect the values - * expected by other code, by stripping the "lib/python$VERSION/..." stuff + * expected by other code, by stripping the "$lib/python$VERSION/..." stuff * off. If either points to the build directory, the globals are reset to * the corresponding preprocessor variables (so sys.prefix will reflect the * installation location, even though sys.path points into the build @@ -101,8 +102,8 @@ #endif -#if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH) -#error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" +#if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH) || !defined(PLATLIBDIR) +#error "PREFIX, EXEC_PREFIX, VERSION, VPATH and PLATLIBDIR must be constant defined" #endif #ifndef LANDMARK @@ -494,7 +495,7 @@ calculate_path(void) _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); _prefix = Py_DecodeLocale(PREFIX, NULL); _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); - lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); + lib_python = Py_DecodeLocale(PLATLIBDIR "/python" VERSION, NULL); if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { Py_FatalError( Index: Python-3.6.0/Lib/distutils/command/install.py =================================================================== --- Python-3.6.0.orig/Lib/distutils/command/install.py +++ Python-3.6.0/Lib/distutils/command/install.py @@ -30,7 +30,7 @@ WINDOWS_SCHEME = { INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', - 'platlib': '$platbase/lib/python$py_version_short/site-packages', + 'platlib': '$platbase/$platlibdir/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$base/bin', 'data' : '$base', @@ -284,7 +284,7 @@ class install(Command): # about needing recursive variable expansion (shudder). py_version = sys.version.split()[0] - (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') + (prefix, exec_prefix, platlibdir) = get_config_vars('prefix', 'exec_prefix', 'platlibdir') try: abiflags = sys.abiflags except AttributeError: @@ -301,6 +301,7 @@ class install(Command): 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, 'abiflags': abiflags, + 'platlibdir': platlibdir, } if HAS_USER_SITE: Index: Python-3.6.0/Lib/distutils/sysconfig.py =================================================================== --- Python-3.6.0.orig/Lib/distutils/sysconfig.py +++ Python-3.6.0/Lib/distutils/sysconfig.py @@ -132,8 +132,9 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": + libdir = plat_specific and get_config_var("platlibdir") or "lib" libpython = os.path.join(prefix, - "lib", "python" + get_python_version()) + libdir, "python" + get_python_version()) if standard_lib: return libpython else: Index: Python-3.6.0/Lib/sysconfig.py =================================================================== --- Python-3.6.0.orig/Lib/sysconfig.py +++ Python-3.6.0/Lib/sysconfig.py @@ -20,10 +20,10 @@ __all__ = [ _INSTALL_SCHEMES = { 'posix_prefix': { - 'stdlib': '{installed_base}/lib/python{py_version_short}', - 'platstdlib': '{platbase}/lib/python{py_version_short}', + 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', + 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/site-packages', - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', + 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': Index: Python-3.6.0/Lib/pydoc.py =================================================================== --- Python-3.6.0.orig/Lib/pydoc.py +++ Python-3.6.0/Lib/pydoc.py @@ -63,6 +63,7 @@ import pkgutil import platform import re import sys +import sysconfig import time import tokenize import urllib.parse @@ -395,9 +396,7 @@ class Doc: docmodule = docclass = docroutine = docother = docproperty = docdata = fail - def getdocloc(self, object, - basedir=os.path.join(sys.base_exec_prefix, "lib", - "python%d.%d" % sys.version_info[:2])): + def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')): """Return the location of module docs or None""" try: Index: Python-3.6.0/Lib/site.py =================================================================== --- Python-3.6.0.orig/Lib/site.py +++ Python-3.6.0/Lib/site.py @@ -304,9 +304,15 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': - sitepackages.append(os.path.join(prefix, "lib", + from sysconfig import get_config_var + platlibdir = get_config_var("platlibdir") + sitepackages.append(os.path.join(prefix, platlibdir, "python%d.%d" % sys.version_info[:2], "site-packages")) + if platlibdir != "lib": + sitepackages.append(os.path.join(prefix, "lib", + "python%d.%d" % sys.version_info[:2], + "site-packages")) else: sitepackages.append(prefix) sitepackages.append(os.path.join(prefix, "lib", "site-packages")) Index: Python-3.6.0/Lib/trace.py =================================================================== --- Python-3.6.0.orig/Lib/trace.py +++ Python-3.6.0/Lib/trace.py @@ -53,6 +53,7 @@ import linecache import os import re import sys +import sysconfig import token import tokenize import inspect @@ -677,9 +678,8 @@ def main(): opts = parser.parse_args() if opts.ignore_dir: - rel_path = 'lib', 'python{0.major}.{0.minor}'.format(sys.version_info) - _prefix = os.path.join(sys.base_prefix, *rel_path) - _exec_prefix = os.path.join(sys.base_exec_prefix, *rel_path) + _prefix = sysconfig.get_path("stdlib") + _exec_prefix = sysconfig.get_path("platstdlib") def parse_ignore_dir(s): s = os.path.expanduser(os.path.expandvars(s)) Index: Python-3.6.0/Lib/test/test_site.py =================================================================== --- Python-3.6.0.orig/Lib/test/test_site.py +++ Python-3.6.0/Lib/test/test_site.py @@ -247,8 +247,9 @@ class HelperFunctionsTests(unittest.Test self.assertEqual(dirs[1], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', + platlibdir = sysconfig.get_config_var('platlibdir') + self.assertTrue(len(dirs) in (1,2)) + wanted = os.path.join('xoxo', platlibdir, 'python%d.%d' % sys.version_info[:2], 'site-packages') self.assertEqual(dirs[0], wanted) Index: Python-3.6.0/Lib/test/test_sysconfig.py =================================================================== --- Python-3.6.0.orig/Lib/test/test_sysconfig.py +++ Python-3.6.0/Lib/test/test_sysconfig.py @@ -265,6 +265,7 @@ class TestSysConfig(unittest.TestCase): # is similar to the global posix_prefix one base = get_config_var('base') user = get_config_var('userbase') + platlibdir = get_config_var("platlibdir") # the global scheme mirrors the distinction between prefix and # exec-prefix but not the user scheme, so we have to adapt the paths # before comparing (issue #9100) @@ -279,8 +280,19 @@ class TestSysConfig(unittest.TestCase): # before comparing global_path = global_path.replace(sys.base_prefix, sys.prefix) base = base.replace(sys.base_prefix, sys.prefix) + + if platlibdir != "lib": + platbase = os.path.join(base, platlibdir) + purebase = os.path.join(base, "lib") + userlib = os.path.join(user, "lib") + # replace platbase first because usually purebase is a prefix of platbase + # /usr/lib is prefix of /usr/lib64 and would get replaced first + modified_path = global_path.replace(platbase, userlib, 1).replace(purebase, userlib, 1) + else: + modified_path = global_path.replace(base, user, 1) + user_path = get_path(name, 'posix_user') - self.assertEqual(user_path, global_path.replace(base, user, 1)) + self.assertEqual(user_path, modified_path) def test_main(self): # just making sure _main() runs and returns things in the stdout ++++++ python.keyring ++++++ Binary files /var/tmp/diff_new_pack.LGZPe6/_old and /var/tmp/diff_new_pack.LGZPe6/_new differ ++++++ python3-ncurses-6.0-accessors.patch ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.633710466 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.633710466 +0100 @@ -1,8 +1,8 @@ -Index: Python-3.5.0/Modules/_cursesmodule.c +Index: Python-3.6.0/Modules/_cursesmodule.c =================================================================== ---- Python-3.5.0.orig/Modules/_cursesmodule.c -+++ Python-3.5.0/Modules/_cursesmodule.c -@@ -1070,7 +1070,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb +--- Python-3.6.0.orig/Modules/_cursesmodule.c ++++ Python-3.6.0/Modules/_cursesmodule.c +@@ -1071,7 +1071,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb return NULL; #ifdef WINDOW_HAS_FLAGS @@ -11,7 +11,7 @@ return PyCursesCheckERR(pechochar(self->win, ch | attr), "echochar"); else -@@ -1593,7 +1593,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind +@@ -1610,7 +1610,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind #ifndef WINDOW_HAS_FLAGS if (0) #else @@ -20,7 +20,7 @@ #endif { switch(PyTuple_Size(args)) { -@@ -1768,7 +1768,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj +@@ -1785,7 +1785,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj #ifndef WINDOW_HAS_FLAGS if (0) #else @@ -29,7 +29,7 @@ #endif { switch(PyTuple_Size(args)) { -@@ -1835,7 +1835,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje +@@ -1852,7 +1852,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */ #ifdef WINDOW_HAS_FLAGS ++++++ skipped_tests.py ++++++ #!/usr/bin/python3 """ Simple regexp-based skipped test checker. It lists tests that are mentioned (presumably for exclusion) in BASE, and in MAIN (presumably for inclusion) and reports discrepancies. This will have a number of """ BASE = "python3-base.spec" MAIN = "python3.spec" import glob import re from os.path import basename alltests = set() qemu_exclusions = set() for item in glob.glob("Python-*/Lib/test/test_*"): testname = basename(item) if testname.endswith(".py"): testname = testname[:-3] alltests.add(testname) testre = re.compile(r'[\s"](test_\w+)\b') def find_tests_in_spec(specname): global qemu_exclusions found_tests = set() with open(specname) as spec: in_qemu = False for line in spec: line = line.strip() if "#" in line: line = line[:line.index("#")] tests = set(testre.findall(line)) found_tests |= tests if line == "%if 0%{?qemu_user_space_build} > 0": in_qemu = True if in_qemu: if line == "%endif": in_qemu = False qemu_exclusions |= tests return found_tests excluded = find_tests_in_spec(BASE) included = find_tests_in_spec(MAIN) #print("--- excluded tests:", " ".join(sorted(excluded))) #print("--- included tests:", " ".join(sorted(included))) mentioned = excluded | included nonexistent = mentioned - alltests missing = excluded - included - qemu_exclusions print("--- the following tests are excluded for QEMU and not tested in python") print("--- (that probably means we don't need to worry about them)") for test in sorted(qemu_exclusions - included): print(test) print("--- the following tests might be excluded from python-base but not tested in python:") for test in sorted(missing): print(test) if nonexistent: print("--- the following tests don't exist:") for test in sorted(nonexistent): print(test) ++++++ subprocess-raise-timeout.patch ++++++ --- /var/tmp/diff_new_pack.LGZPe6/_old 2017-02-19 00:45:08.721698084 +0100 +++ /var/tmp/diff_new_pack.LGZPe6/_new 2017-02-19 00:45:08.721698084 +0100 @@ -1,8 +1,8 @@ -Index: Python-3.4.0/Lib/test/test_subprocess.py +Index: Python-3.6.0/Lib/test/test_subprocess.py =================================================================== ---- Python-3.4.0.orig/Lib/test/test_subprocess.py 2014-03-17 03:31:30.000000000 +0100 -+++ Python-3.4.0/Lib/test/test_subprocess.py 2014-03-26 16:23:08.489610918 +0100 -@@ -991,7 +991,8 @@ +--- Python-3.6.0.orig/Lib/test/test_subprocess.py ++++ Python-3.6.0/Lib/test/test_subprocess.py +@@ -1013,7 +1013,8 @@ class ProcessTestCase(BaseTestCase): self.assertIn("0.0001", str(c.exception)) # For coverage of __str__. # Some heavily loaded buildbots (sparc Debian 3.x) require this much # time to start. @@ -10,5 +10,5 @@ + # OBS might require even more + self.assertEqual(p.wait(timeout=10), 0) - def test_invalid_bufsize(self): - # an invalid type of the bufsize argument should raise + def test_wait_endtime(self): + """Confirm that the deprecated endtime parameter warns.""" ++++++ test-socket-aead-kernel49.patch ++++++ Index: Python-3.6.0/Lib/test/test_socket.py =================================================================== --- Python-3.6.0.orig/Lib/test/test_socket.py +++ Python-3.6.0/Lib/test/test_socket.py @@ -5456,7 +5456,7 @@ class LinuxKernelCryptoAPI(unittest.Test self.assertEqual(len(dec), msglen * multiplier) self.assertEqual(dec, msg * multiplier) - @support.requires_linux_version(4, 3) # see test_aes_cbc + @support.requires_linux_version(4, 9) # see issue29324 def test_aead_aes_gcm(self): key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c') iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2') @@ -5479,8 +5479,7 @@ class LinuxKernelCryptoAPI(unittest.Test op.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, iv=iv, assoclen=assoclen, flags=socket.MSG_MORE) op.sendall(assoc, socket.MSG_MORE) - op.sendall(plain, socket.MSG_MORE) - op.sendall(b'\x00' * taglen) + op.sendall(plain) res = op.recv(assoclen + len(plain) + taglen) self.assertEqual(expected_ct, res[assoclen:-taglen]) self.assertEqual(expected_tag, res[-taglen:]) @@ -5488,7 +5487,7 @@ class LinuxKernelCryptoAPI(unittest.Test # now with msg op, _ = algo.accept() with op: - msg = assoc + plain + b'\x00' * taglen + msg = assoc + plain op.sendmsg_afalg([msg], op=socket.ALG_OP_ENCRYPT, iv=iv, assoclen=assoclen) res = op.recv(assoclen + len(plain) + taglen) @@ -5499,7 +5498,7 @@ class LinuxKernelCryptoAPI(unittest.Test pack_uint32 = struct.Struct('I').pack op, _ = algo.accept() with op: - msg = assoc + plain + b'\x00' * taglen + msg = assoc + plain op.sendmsg( [msg], ([socket.SOL_ALG, socket.ALG_SET_OP, pack_uint32(socket.ALG_OP_ENCRYPT)], @@ -5507,7 +5506,7 @@ class LinuxKernelCryptoAPI(unittest.Test [socket.SOL_ALG, socket.ALG_SET_AEAD_ASSOCLEN, pack_uint32(assoclen)], ) ) - res = op.recv(len(msg)) + res = op.recv(len(msg) + taglen) self.assertEqual(expected_ct, res[assoclen:-taglen]) self.assertEqual(expected_tag, res[-taglen:]) @@ -5517,8 +5516,8 @@ class LinuxKernelCryptoAPI(unittest.Test msg = assoc + expected_ct + expected_tag op.sendmsg_afalg([msg], op=socket.ALG_OP_DECRYPT, iv=iv, assoclen=assoclen) - res = op.recv(len(msg)) - self.assertEqual(plain, res[assoclen:-taglen]) + res = op.recv(len(msg) - taglen) + self.assertEqual(plain, res[assoclen:]) @support.requires_linux_version(4, 3) # see test_aes_cbc def test_drbg_pr_sha256(self):