maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [Announce] Python3.2 (3.2.3) on extras-devel (https://talk.maemo.org/showthread.php?t=91777)

MartinK 2014-03-27 23:29

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Quote:

Originally Posted by marmistrz (Post 1418195)
Aapo, can you please optify it?

A big +1 from me for this. A properly optified Python 3.2 should make the modRana Qt 5 & Python 3 based GUI (once I finally get it working) much more accessible to users. :)

peterleinchen 2014-03-28 05:43

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
I would also like an optified version, as my rootfs is almost full (still may optify it a bit manually).

But another question here, if it is possible at all?
If yes would it be possible to optify python-2.5 (moving /usr/lib/python-2.5/ to opt), which is 'wasting' over 20MB on rootfs?

pichlo 2014-03-28 06:41

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Quote:

Originally Posted by peterleinchen (Post 1418825)
If yes would it be possible to optify python-2.5 (moving /usr/lib/python-2.5/ to opt), which is 'wasting' over 20MB on rootfs?

Does it? I thought Python 2.5 was the ultimate (horrible, IMO) example of optification on Maemo through mounting.

Code:

~ $ mount
rootfs on / type rootfs (rw)
ubi0:rootfs on / type ubifs (rw,bulk_read,no_chk_data_crc)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,noatime,size=1024k)
tmpfs on /var/run type tmpfs (rw,nosuid,noatime,size=256k,mode=755)
none on /dev type tmpfs (rw,noatime,size=10240k,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noatime,size=65536k)
/dev/mmcblk0p2 on /home type ext3 (noatime,nodiratime,errors=continue,commit=1,data=writeback)
/home/opt on /opt type none (bind,rbind)
nodev on /sys/kernel/debug type debugfs (0)
/opt/pymaemo/usr/lib/python2.5 on /usr/lib/python2.5 type bind (bind,rbind)
/opt/pymaemo/usr/share/pyshared on /usr/share/pyshared type bind (bind,rbind)
/opt/pymaemo/usr/lib/pyshared on /usr/lib/pyshared type bind (bind,rbind)
/opt/pymaemo/usr/share/python-support on /usr/share/python-support type bind (bind,rbind)
/opt/pymaemo/usr/lib/python-support on /usr/lib/python-support type bind (bind,rbind)
/dev/mmcblk0p1 on /home/user/MyDocs type vfat (rw,noauto,nodev,exec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir)
/dev/mmcblk1p1 on /media/mmc1 type vfat (rw,noauto,nodev,exec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir)
~ $


peterleinchen 2014-03-28 07:00

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Ups, sorry.

Yes, read that part of mount so often that it seems I do ignore it fully.
:mad: damn, thought I could free up some space... [down to 10MB]


--edit (OT)
Just checked once more (and it is actually 79.8 MB ;)).
But why I thought so is
du -xsh /usr/lib/
shows 79.8 for python2.5. And -x should not show space on other file system. Seems a mounted (different) file system is not recognized by 'du'?

reinob 2014-03-28 08:48

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
@peterleinchen

If I do "du -h /usr/lib" I get 201.5M. If I do "du -xh /usr/lib" I get 141.4M.

Doing a diff on both outputs it is clear that "-xh" omits/ignores the 3 directories that are bind-mounted on /usr/lib, i.e. python2.5, pyshared and python-support.

You are probably doing "du -xsh /usr/lib/*" (note the "*") which is effectively overriding the "-x" by telling du explicitly to calculate the size of every directory under /usr/lib/, that is, including those [r]bind-mounted.

peterleinchen 2014-03-28 18:44

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Yes, exactly that is. (I expected a different behaviour, but from the view of directory hierarchy this makes sense.)

Muchos gracias.

-- end of OT

AapoRantalainen 2014-04-20 08:06

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:

./configure --prefix=/opt/python3/ \
                --enable-ipv6 \
                --enable-loadable-sqlite-extensions \
                --with-dbmliborder=bdb:gdbm \
                --with-computed-gotos \
                --without-ensurepip \
                --without-system-expat \
                --without-system-libmpdec

(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.

AapoRantalainen 2014-04-20 08:12

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
And of cource you should be interested in test-results (feel free to run on your device, tests are installed):
I dont yet understand everything, feel free to comment what are critical.

Code:

cd /opt/python3/lib/python3.4/test/
time python3 regrtest.py

(modified results:)
Code:

== CPython 3.4.0 (default, Apr 19 2014, 16:37:49) [GCC 4.2.1]
==  Linux-2.6.28.10-power52-armv7l-with-debian-testing-unstable little-endian
==  hash algorithm: siphash24 32bit
==  /var/tmp/test_python_22590
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[  6/389] test_types
Warning -- locale was modified by test_types
[ 23/389] test_asyncio
test_asyncio skipped -- cannot import name '_base'
[ 40/389] test_calendar
Warning -- locale was modified by test_calendar
[ 60/389] test_codecmaps_cn
test_codecmaps_cn skipped -- Use of the 'urlfetch' resource not enabled
[ 61/389] test_codecmaps_hk
test_codecmaps_hk skipped -- Use of the 'urlfetch' resource not enabled
[ 62/389] test_codecmaps_jp
test_codecmaps_jp skipped -- Use of the 'urlfetch' resource not enabled
[ 63/389] test_codecmaps_kr
test_codecmaps_kr skipped -- Use of the 'urlfetch' resource not enabled
[ 64/389] test_codecmaps_tw
test_codecmaps_tw skipped -- Use of the 'urlfetch' resource not enabled
[ 71/389] test_compileall
test test_compileall failed -- Traceback (most recent call last):
  File "/opt/python3/lib/python3.4/test/test_compileall.py", line 194, in test_no_args_respects_force_flag
    self.assertRunOK('-f', PYTHONPATH=self.directory)
  File "/opt/python3/lib/python3.4/test/test_compileall.py", line 144, in assertRunOK
    *self._get_run_args(args), **env_vars)
  File "/opt/python3/lib/python3.4/test/script_helper.py", line 69, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/opt/python3/lib/python3.4/test/script_helper.py", line 55, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:

[ 73/389/1] test_concurrent_futures
test_concurrent_futures skipped -- No module named '_multiprocessing'
[ 83/389/1] test_ctypes
test test_ctypes failed -- multiple errors occurred; run in verbose mode for details
[ 84/389/2] test_curses
test_curses skipped -- Use of the 'curses' resource not enabled
[ 96/389/2] test_devpoll
test_devpoll skipped -- select.devpoll not defined
[101/389/2] test_distutils
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
[124/389/3] test_float
Warning -- locale was modified by test_float
[139/389/3] test_gdb
test_gdb skipped -- test_gdb only works on source builds at the moment.
[181/389/3] test_kqueue
test_kqueue skipped -- test works only on BSD
[187/389/3] test_locale
Warning -- locale was modified by test_locale
[206/389/3] test_msilib
test_msilib skipped -- No module named 'msilib'
[208/389/3] test_multiprocessing_fork
test_multiprocessing_fork skipped -- No module named '_multiprocessing'
[209/389/3] test_multiprocessing_forkserver
test_multiprocessing_forkserver skipped -- No module named '_multiprocessing'
[210/389/3] test_multiprocessing_main_handling
test_multiprocessing_main_handling skipped -- No module named '_multiprocessing'
[211/389/3] test_multiprocessing_spawn
test_multiprocessing_spawn skipped -- No module named '_multiprocessing'
[223/389/3] test_ossaudiodev
test_ossaudiodev skipped -- Use of the 'audio' resource not enabled
[292/389/3] test_smtpnet
test_smtpnet skipped -- Use of the 'network' resource not enabled
[295/389/3] test_socketserver
test_socketserver skipped -- Use of the 'network' resource not enabled
[300/389/3] test_startfile
test_startfile skipped -- object <module 'os' from '/opt/python3/lib/python3.4/os.py'> has no attribute 'startfile'
[307/389/3] test_strptime
Warning -- locale was modified by test_strptime
[312/389/3] test_subprocess
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
test test_subprocess failed -- multiple errors occurred; run in verbose mode for details
[318/389/4] test_sys
test test_sys failed -- Traceback (most recent call last):
  File "/opt/python3/lib/python3.4/test/test_sys.py", line 605, in test_executable
    self.assertEqual(os.path.abspath(sys.executable), sys.executable)
AssertionError: '/opt/python3/bin/python3' != '/opt/python3/lib/python3.4/test/../../../bin/python3'
- /opt/python3/bin/python3
+ /opt/python3/lib/python3.4/test/../../../bin/python3

[336/389/5] test_timeout
test_timeout skipped -- Use of the 'network' resource not enabled
[337/389/5] test_tk
test_tk skipped -- Use of the 'gui' resource not enabled
[338/389/5] test_tokenize
[339/389/5] test_tools
test_tools skipped -- test irrelevant for an installed Python
[343/389/5] test_ttk_guionly
test_ttk_guionly skipped -- Use of the 'gui' resource not enabled
[358/389/5] test_urllib2net
test_urllib2net skipped -- Use of the 'network' resource not enabled
[360/389/5] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
[367/389/5] test_venv
test test_venv failed -- multiple errors occurred; run in verbose mode for details
[375/389/6] test_winreg
test_winreg skipped -- No module named 'winreg'
[376/389/6] test_winsound
test_winsound skipped -- Use of the 'audio' resource not enabled
[384/389/6] test_xmlrpc_net
test_xmlrpc_net skipped -- Use of the 'network' resource not enabled
[386/389/6] test_zipfile64
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
348 tests OK.
6 tests failed:
    test_compileall test_ctypes test_distutils test_subprocess
    test_sys test_venv
5 tests altered the execution environment:
    test_calendar test_float test_locale test_strptime test_types
30 tests skipped:
    test_asyncio test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
    test_codecmaps_kr test_codecmaps_tw test_concurrent_futures
    test_curses test_devpoll test_gdb test_kqueue test_msilib
    test_multiprocessing_fork test_multiprocessing_forkserver
    test_multiprocessing_main_handling test_multiprocessing_spawn
    test_ossaudiodev test_smtpnet test_socketserver test_startfile
    test_timeout test_tk test_tools test_ttk_guionly test_urllib2net
    test_urllibnet test_winreg test_winsound test_xmlrpc_net
    test_zipfile64

real    85m24.808s
user    71m53.664s
sys    5m36.367s


You can run simple test with (e.g)
Code:

root
python3 regrtest.py test_zipfile64


[EDIT]
Tests 60,61,62,63,64
You need write access to the directory:
Code:

chown -R user /opt/python3/lib/python3.4/test
And 'resource urlfetch'
Code:

python3 regrtest.py -uurlfetch test_codecmaps_cn test_codecmaps_hk  test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw
[/EDIT]

Sohil876 2014-04-20 09:09

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Quote:

Originally Posted by AapoRantalainen (Post 1422000)
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:

./configure --prefix=/opt/python3/ \
                --enable-ipv6 \
                --enable-loadable-sqlite-extensions \
                --with-dbmliborder=bdb:gdbm \
                --with-computed-gotos \
                --without-ensurepip \
                --without-system-expat \
                --without-system-libmpdec

(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.

Thanks. A little ot request i know but if you have spare time can you also upload pygame for this python version?

MartinK 2014-04-20 10:47

Re: [Announce] Python3.2 (3.2.3) on extras-devel
 
Quote:

Originally Posted by AapoRantalainen (Post 1422000)
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:

./configure --prefix=/opt/python3/ \
                --enable-ipv6 \
                --enable-loadable-sqlite-extensions \
                --with-dbmliborder=bdb:gdbm \
                --with-computed-gotos \
                --without-ensurepip \
                --without-system-expat \
                --without-system-libmpdec

(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.

Thanks a lot ! With this & the Qt 5 port only PyOtherSide is needed to enable the modRana Qt 5 GUI & other Python 3 & Qt 5 apps to run on the N900. :)

BTW, we now have the same version of Python Sailfish has (3.4), which is even newer than the Python version in the latest Fedora (3.3). :D


All times are GMT. The time now is 18:59.

vBulletin® Version 3.8.8