Hello community, here is the log from the commit of package python3 for openSUSE:Factory checked in at 2012-12-10 10:11:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3 (Old) and /work/SRC/openSUSE:Factory/.python3.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3", Maintainer is "JMatejek@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/python3/python3-base.changes 2012-11-06 16:20:14.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3.new/python3-base.changes 2012-12-10 10:11:23.000000000 +0100 @@ -1,0 +2,24 @@ +Thu Nov 29 17:02:37 UTC 2012 - jmatejek@suse.com + +- fix include path in macros (bnc#787526) +- implement failed import handlers for modules that live in + subpackages - e.g. "import ssl" will now throw a sensible error + message telling you to install "python3" + +------------------------------------------------------------------- +Wed Nov 28 17:02:07 UTC 2012 - jmatejek@suse.com + +- merge python3-xml into python3 +- merge python3-2to3 library into python3-base + and the 2to3 binary into python3-devel + (python3-devel is now in conflict with python-2to3, which + will be dropped) +- enable --with-system-expat for python3, making the xml modules + (and thus python3) depend on expat +- reconfigure tests to disable network and GUI resources, which + the upstream apparently thought is a good idea to enable by default. + this fixes build failures in Factory +- add lzma-devel to build the _lzma module +- moved %dynlib macro definition to common section + +------------------------------------------------------------------- python3.changes: same change New: ---- import_failed.map import_failed.py ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-base.spec ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -51,6 +51,8 @@ Source4: python3.sh Source5: python3.csh Source7: macros.python3.py +Source8: import_failed.py +Source9: import_failed.map Source99: PACKAGING-NOTES # this is documentation for packagers, put here to silence Factory source_validator @@ -100,6 +102,7 @@ %define so_version %{python_version_soname}%{abi_kind}1_0 +%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.so ### COMMON-DEF-END ### %description @@ -121,7 +124,7 @@ Requires: %{name} = %{version} Summary: Python Utility and Demonstration Scripts Group: Development/Languages/Python -Obsoletes: python3-demo < %{version} +Obsoletes: python3-demo <= %{version} Provides: python3-demo = %{version} %description -n python3-tools @@ -144,6 +147,8 @@ %package -n python3-devel Requires: %{name} = %{version} +Provides: python3-2to3 = %{version} +Obsoletes: python3-2to3 <= %{version} Summary: Include Files and Libraries Mandatory for Building Python Modules Group: Development/Languages/Python @@ -171,24 +176,6 @@ They are a documented part of stdlib, as a module 'test'. -%package -n python3-xml -Requires: %{name} = %{version} -Summary: A Python XML Interface -Group: Development/Libraries/Python - -%description -n python3-xml -The expat module is a Python interface to the expat XML parser. Since -Python2.x, it is part of the core Python distribution. - - -%package -n python3-2to3 -Requires: %{name} = %{version} -Summary: Python 3.0 conversion tool -Group: Development/Languages/Python - -%description -n python3-2to3 -Python3's version of the 2to3 conversion library. - %package -n libpython%{so_version} Summary: Python Interpreter shared library Group: Development/Languages/Python @@ -280,7 +267,7 @@ if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then ulimit -v 10000000 || : fi -make test TESTOPTS="$EXCLUDE" +make test TESTOPTS="-u -network,-gui $EXCLUDE" # use network, be verbose: #make test TESTOPTS="-l -u network -v" @@ -309,9 +296,10 @@ mkdir -p ${RPM_BUILD_ROOT}/usr/lib/python%{python_version}/site-packages/__pycache__ # cleanup parts that don't belong -for dir in curses dbm sqlite3 tkinter; do +for dir in curses dbm sqlite3 tkinter xml xmlrpc; do find $RPM_BUILD_ROOT%{sitedir}/$dir/* -maxdepth 0 -name "test" -o -exec rm -rf {} ";" done +rm $RPM_BUILD_ROOT%{dynlib pyexpat} # overwrite the copied binary with a link ln -sf python%{python_version} ${RPM_BUILD_ROOT}%{_bindir}/python3 @@ -356,6 +344,27 @@ mkdir -p $RPM_BUILD_ROOT/etc/rpm LD_LIBRARY_PATH=. ./python %{S:7} > $RPM_BUILD_ROOT/etc/rpm/macros.python3 +# import_failed hooks +FAILDIR=$RPM_BUILD_ROOT/%{sitedir}/_import_failed +mkdir $FAILDIR +install -m 644 %{S:8} %{S:9} $FAILDIR +LD_LIBRARY_PATH=. ./python -c "from py_compile import compile; compile('$FAILDIR/import_failed.py', dfile='%{sitedir}/_import_failed/import_failed.py')" +LD_LIBRARY_PATH=. ./python -O -c "from py_compile import compile; compile('$FAILDIR/import_failed.py', dfile='%{sitedir}/_import_failed/import_failed.py')" +( + cd $FAILDIR + while read package modules; do + for module in $modules; do + ln import_failed.py $module.py + pushd __pycache__ + for i in import_failed*; do + ln $i $module${i%import_failed} + done + popd + done + done < %{S:9} +) +echo %{sitedir}/_import_failed > $RPM_BUILD_ROOT/%{sitedir}/site-packages/zzzz-import-failed-hooks.pth + %clean rm -rf $RPM_BUILD_ROOT @@ -363,8 +372,6 @@ %postun -n libpython%{so_version} -p /sbin/ldconfig -%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.so - %files -n libpython%{so_version} %defattr(644, root,root) %{_libdir}/libpython%{python_abi}.so.* @@ -387,12 +394,6 @@ %attr(755, root, root) %{_bindir}/idle3 %attr(755, root, root) %{_bindir}/idle%{python_version} -%files -n python3-xml -%defattr(644, root, root, 755) -%{sitedir}/xml -%{sitedir}/xmlrpc -%{dynlib pyexpat} - %files -n python3-devel %defattr(644, root, root, 755) %{_libdir}/libpython%{python_abi}.so @@ -404,6 +405,8 @@ %{_bindir}/python%{python_abi}-config %{_bindir}/python%{python_version}-config %{_bindir}/python3-config +%{_bindir}/2to3 +%{_bindir}/2to3-%{python_version} %files -n python3-testsuite %defattr(644, root, root, 755) @@ -415,12 +418,6 @@ %dir %{sitedir}/sqlite3 %dir %{sitedir}/tkinter -%files -n python3-2to3 -%defattr(644, root, root, 755) -%attr(755, root, root) %{_bindir}/2to3 -%attr(755, root, root) %{_bindir}/2to3-%{python_version} -%{sitedir}/lib2to3 - %files %defattr(644, root, root, 755) # profile files @@ -508,6 +505,7 @@ %{sitedir}/http %{sitedir}/importlib %{sitedir}/json +%{sitedir}/lib2to3 %{sitedir}/logging %{sitedir}/multiprocessing %{sitedir}/plat-* @@ -518,6 +516,9 @@ %{sitedir}/wsgiref %{sitedir}/site-packages/README %{sitedir}/__pycache__ +# import-failed hooks +%{sitedir}/_import_failed +%{sitedir}/site-packages/zzzz-import-failed-hooks.pth # executables %attr(755, root, root) %{_bindir}/pydoc3 %attr(755, root, root) %{_bindir}/pydoc%{python_version} ++++++ python3-doc.spec ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -82,6 +82,7 @@ %define so_version %{python_version_soname}%{abi_kind}1_0 +%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.so ### COMMON-DEF-END ### %description ++++++ python3.spec ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -26,8 +26,10 @@ BuildRequires: gmp-devel BuildRequires: intltool BuildRequires: libbz2-devel +BuildRequires: libexpat-devel BuildRequires: libffi-devel BuildRequires: libopenssl-devel +BuildRequires: lzma-devel BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: sqlite-devel @@ -43,7 +45,6 @@ %define tarname Python-%{tarversion} Requires: python3-base = %{version} -BuildRequires: python3-base = %{version} Source0: %{tarname}.tar.bz2 Source1: baselibs.conf @@ -105,12 +106,16 @@ %define so_version %{python_version_soname}%{abi_kind}1_0 +%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.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 @@ -194,8 +199,8 @@ --enable-ipv6 \ --with-fpectl \ --enable-shared \ - --with-wide-unicode \ - --with-system-ffi + --with-system-ffi \ + --with-system-expat make %{?_smp_mflags} # DESTDIR=$RPM_BUILD_ROOT @@ -206,7 +211,7 @@ fi # only test the parts skipped in python3-base TESTS="test_bz2 test_lzma test_dbm_gnu test_dbm_ndbm test_readline test_ssl test_tcl test_tk test_ttk_guionly test_ttk_textonly test_curses test_socketserver test_sqlite test_hashlib test_smtpnet" -make test TESTOPTS="$TESTS" +make test TESTOPTS="-u -network,-gui $TESTS" %install # replace rest of /usr/local/bin/python or /usr/bin/python2.5 with /usr/bin/python3 @@ -236,7 +241,7 @@ for module in \ ctypes collections concurrent distutils email encodings html http \ importlib json logging multiprocessing plat-* pydoc_data unittest \ - urllib venv wsgiref lib2to3 test xml xmlrpc idlelib turtledemo + urllib venv wsgiref lib2to3 test idlelib turtledemo do rm -r $RPM_BUILD_ROOT%{sitedir}/$module done @@ -246,7 +251,7 @@ _ctypes _datetime _decimal _elementtree fcntl grp _heapq _json _lsprof \ math mmap _multibytecodec _multiprocessing nis ossaudiodev parser _pickle \ _posixsubprocess _random resource select _socket spwd _struct syslog \ - termios _testbuffer time unicodedata zlib pyexpat _ctypes_test _testcapi \ + termios _testbuffer time unicodedata zlib _ctypes_test _testcapi \ _md5 _sha1 _sha256 _sha512 do eval rm "$RPM_BUILD_ROOT%{sitedir}/lib-dynload/$library.*" @@ -254,8 +259,6 @@ %fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version} -%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.so - %files tk %defattr(644, root, root, 755) %{sitedir}/tkinter @@ -278,7 +281,11 @@ %dir %{sitedir} %dir %{sitedir}/lib-dynload %{sitedir}/sqlite3 +%{sitedir}/xml +%{sitedir}/xmlrpc %{dynlib _hashlib} +%{dynlib _lzma} +%{dynlib pyexpat} %{dynlib readline} %{dynlib _sqlite3} %{dynlib _ssl} ++++++ PACKAGING-NOTES ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -20,7 +20,7 @@ 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 and some small pieces like ssl, hashlib and sqlite. +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? ++++++ import_failed.map ++++++ python3-tools: turtledemo python3-idle: idlelib python3-testsuite: test _ctypes_test _testcapi python3-tk: tkinter _tkinter python3-curses: curses _curses _curses_panel python3-dbm: dbm _dbm _gdbm python3: sqlite3 xml xmlrpc _hashlib _lzma pyexpat readline _sqlite3 _ssl xxlimited ++++++ import_failed.py ++++++ import sys, os from sysconfig import get_path failed_map_path = os.path.join(get_path('stdlib'), '_import_failed', 'import_failed.map') for line in open(failed_map_path): words = line.strip().split() if not words or words[0][0] == '#': continue assert words[0][-1] == ':' package = words[0][:-1] if __name__ in words[1:]: raise ImportError("""Module '{}' is not installed. Use: sudo zypper install {} to install it.""".format(__name__, package)) raise ImportError("""Module '{}' is not installed. It is supposed to be part of python3 distribution, but missing from failed import map. Please file a bug on the Novell Bugzilla.""") ++++++ macros.python3.py ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -6,12 +6,15 @@ from sysconfig import get_path, get_config_var version = "{}.{}".format(*sys.version_info) +abiflags = get_config_var("ABIFLAGS") macros = { "py3_ver": version, "py3_prefix": sys.prefix, - "py3_incdir": get_path("include"), - "py3_abiflags": get_config_var("ABIFLAGS"), +# 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"), ++++++ pre_checkin.sh ++++++ --- /var/tmp/diff_new_pack.XzSdun/_old 2012-12-10 10:11:25.000000000 +0100 +++ /var/tmp/diff_new_pack.XzSdun/_new 2012-12-10 10:11:25.000000000 +0100 @@ -75,3 +75,56 @@ done osc service localrun format_spec_file + + +# create import_failed.map from package definitions + +MAPFILE=import_failed.map +function new_map_line () { + if [ -z "$1" -o -z "$2" ]; then + return + fi + if [ "$1" == "python3-base" ]; then + return + fi + echo "$1:$2" >> $MAPFILE.tmp +} + +for spec in *.spec; do + basename=${spec%.spec} + package= + modules= + while read line; do + case $line in + "%files -n "*) + new_map_line $package "$modules" + package=${line#"%files -n "} + modules= + ;; + "%files "*) + new_map_line $package "$modules" + package=$basename-${line#"%files "} + modules= + ;; + "%files") + new_map_line $package "$modules" + package=$basename + modules= + ;; + "%{sitedir}/"*) + word=${line#"%{sitedir}/"} + if ! echo $word | grep -q /; then + modules="$modules $word" + fi + ;; + "%{dynlib "*"}") + word=${line#"%{dynlib "} + word=${word%"}"} + modules="$modules $word" + ;; + esac + done < $spec + new_map_line $package "$modules" +done + +mv $MAPFILE.tmp $MAPFILE -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org