maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Python & Qt5 on Sailfish (https://talk.maemo.org/showthread.php?t=91049)

m4r0v3r 2014-04-01 13:39

Re: Python & Qt5 on Sailfish
 
Quote:

QMAKE_CXXFLAGS += -I/usr/local/include/python3.4m -I/usr/local/include/python3.4m
With that set I receive a Python.h: No such file or directory when attempting to build pyotherside.

I've tried different versions of Python and none work, I've had to explicitly give it the command since no matter what I set :

Quote:

PYTHON_CONFIG = python3.4m-config
Doesn't work, it never ever finds the command

rcolistete 2014-05-11 19:56

Re: Python & Qt5 on Sailfish
 
Some more updated information about :

1) Python on Sailfish :
- it has a wiki Sailfish/Python Development page;
- Python 3.3.3 (and later 3.4.0) is in Sailfish official repositories since Sailfish v1.0.3.8 (31/01/2014);
- it can be installed as a dependency for other software (gPodder, etc) or by manual installation with :
$ pkcon install python3-base
- it is expected to be accepted in Jolla Harbour "soon".

2) PyOtherSide (http://thp.io/2011/pyotherside/) :
- is in Sailfish official repositories since Sailfish v1.0.3.8 (31/01/2014);
- it can be installed as a dependency for other software (gPodder, etc) or by manual installation with :
$ pkcon install pyotherside-qml-plugin-python3-qt5
- has newer versions 1.1 and 1.2 released in 2014;
- is being used by more than 10 Sailfish softwares, and by BlackBerry (10) softwares;
- it is expected to be accepted in Jolla Harbour "soon";
- it as available in Arch Linux repositories and Ubuntu PPA;
- it is cited by the wiki Sailfish/Python Development page.

3) PyQt 5.1.1 :
- is available in OpenRepos.net, with version for Python 2.7 (pyqt) and version for Python 3 (python-pyqt);
- it is cited by the wiki Sailfish/Python Development page.

So Python 3 & Qt 5 development is well supported in Sailfish, so it is time for Python developers to release their softwares for Sailfish. :cool:

evk 2014-05-15 20:35

Re: Python & Qt5 on Sailfish
 
As far as I understand, PyOtherSide is only available for python 3. That's fine, I like python 3. But there aren't many more python 3 packages, so you're restricted to python-base?

rcolistete 2014-05-15 22:52

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by evk (Post 1425536)
As far as I understand, PyOtherSide is only available for python 3. That's fine, I like python 3. But there aren't many more python 3 packages, so you're restricted to python-base?

There are only few Python 3 modules at the moment for Sailfish, but they are being ported, look at Mer COBS and OpenRepos.net for Python 3. Today I've packaged Uncertainties and SymPy for Python 3, by the way.

evk 2014-05-16 15:45

Re: Python & Qt5 on Sailfish
 
OK, great. It's not a big problem for right now since I'm mostly playing around and can always use C++ if I do something serious.

And I'm getting a bit impressed by QML, some rather powerfull stuff can be done.

xerxes2 2014-05-19 08:32

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by rcolistete (Post 1424946)
Some more updated information about :
- Python 3.3.3 (and later 3.4.0) is in Sailfish official repositories since Sailfish v1.0.3.8 (31/01/2014);

Hey thanks for the heads up. :) I just made a PyQt package for py3 too. So on ORN pyqt is for py2 and python-pyqt is for py3. As mentioned earlier there is not that much support yet for py3 in sailfish so I'll keep supporting pyqt for py2 as long as upstreams does, probably a few more years.

rcolistete 2014-05-19 17:01

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by xerxes2 (Post 1425931)
Hey thanks for the heads up. :) I just made a PyQt package for py3 too. So on ORN pyqt is for py2 and python-pyqt is for py3. As mentioned earlier there is not that much support yet for py3 in sailfish so I'll keep supporting pyqt for py2 as long as upstreams does, probably a few more years.

Excellent, so we have 3 options for Python-Qt bindings : PyQt for Python 2.7 & 3, PyOtherSide for Python 3.

Could you make it more explicit that python-pyqt on OpenRepos.Net is for Python 3 ? The only mention is the 1st line after the "%build".

I've updated the post #83.

xerxes2 2014-05-19 17:33

Re: Python & Qt5 on Sailfish
 
I updated the wikipage now with regards to pyqt and also added a software section where we could list all available python apps for sailfish, I found six so far. And hopefully plenty in the oven too. :)

https://wiki.merproject.org/wiki/Sai...pment#Software

rcolistete 2014-05-22 19:14

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by xerxes2 (Post 1425996)
I updated the wikipage now with regards to pyqt and also added a software section where we could list all available python apps for sailfish, I found six so far. And hopefully plenty in the oven too. :)

https://wiki.merproject.org/wiki/Sai...pment#Software

Thanks, I've followed your work and inserted more Python applications (14 until now) for Sailfish :
https://wiki.merproject.org/wiki/Sai...pment#Software
Source-code (GitHub) links were placed when available, they are very useful to other developers to see other softwares as code examples.

xerxes2 2014-05-23 20:19

Re: Python & Qt5 on Sailfish
 
Yeah it looks good ... and so many Python apps already. 13-1 in favor of pos vs pyqt. :) And I added a little bit more info about the differences between pos and pyqt. Feel free to edit/add more info if you like. I never really used pos so I don't know that much about it.

And does anyone know about the situation of introspection in Sailfish? I can't seem to find it so it may not exist at all. If not we must get Jolla to add introspection support for packages they maintain in core Sailfish. I can make an example already that I'll need and that is Gstreamer-1. But the whole G stack with Glib, Gio, Cairo, Pango, Telepathy and possibly some more are only supported from Python with introspection and it would be nice if Jolla would support these with -intro packages.

And if anyone is missing Python libs just ask and I'll try to package them for you. They must be compatible with core Sailfish though as I'll not upgrade such packages.

Khertan 2014-05-28 06:33

Re: Python & Qt5 on Sailfish
 
You can add ownNotes too :

http://github.com/khertan/ownNotes

rcolistete 2014-06-11 03:43

Re: Python & Qt5 on Sailfish
 
Updated 1st post, citing the Sailfish/Python Development wiki page. This wiki page now lists Python 2/3 modules available for Sailfish.

rcolistete 2014-09-08 01:17

Re: Python & Qt5 on Sailfish
 
PyOtherSide was updated in July to version 1.3.0.

PyOtherSide is now available in Debian and Ubuntu repositories.

rcolistete 2014-12-01 12:23

Re: Python & Qt5 on Sailfish
 
Python 3.4 and PyOtherSide will soon be available in Jolla App Store :
#mer-meeting: SailfishOS, open source, collaboration: 25-November @ 15:00 UT
Full logs :
Quote:

15:10:31 <cybette> #info Starting with Update 10, a few new APIs will be allowed in Harbour. For details see log and above link
15:17:03 <M4rtinK_jolla_> what about Python ?
15:17:44 <kontio> M4rtinK_jolla_: pyotherside w/ python will be allowed too

rcolistete 2014-12-25 18:36

Re: Python & Qt5 on Sailfish
 
Softwares using Python/PyOtherSide as dependencies will be accepted by Jolla Harbour Store from 7th January 2015 :

- Jolla Harbour Store has since 15/12/2014 the long pending multiversion support, needed by PyOtherSide (in Sailfish repositories only since 1.0.3.8) :
[SailfishDevel] Changes in Harbour Web UI - Fri Dec 12 15:41:09 UTC 2014
Quote:

We mentioned earlier that in order to allow more libraries and e.g. Python support we need Harbour to be able to accept submissions for certain Sailfish OS versions aka. "multiversion support".
We will deploy that feature on Monday 15. December 2014, starting 08:00 UTC. For local time run on a Linux system:
date -d '2014-12-15 08:00 UTC'
- the new Sailfish SDK from 5th January 2015 and new RPM validator (to be used by Harbour team from 7th January 2015) will allow Python/PyOtherSide as dependencies :
[Release notes] Software version 1.1.1.27, Vaarainjärvi.
Quote:

The corresponding SDK release will be available on the 5th of January 2015. It will include the updated rpmvalidator which allows the new libraries to be used in Store as announced in the community meeting from 25th of November 2014.
Harbour testing team will start using the new rpmvalidator from 7th of January 2015 onwards (note that 6th of January 2015 is a public holiday in Finland).
[SailfishDevel] Harbour & Jolla Developer Care delays during holiday season
Quote:

As mentioned in the release notes for Update 10[1], we will release the corresponding SDK on 5. Jan 2015 and Harbour testing will start using the new rpmvalidator allowing more libraries[2] 7. Jan 2015.

rcolistete 2015-01-05 16:20

Re: Python & Qt5 on Sailfish
 
As said above, the Sailfish SDK Beta 1412 was released today. So Python softwares can be built with it, and sent to Jolla Harbour next Wednesday (January 7th 2015).

rcolistete 2015-01-10 18:39

Re: Python & Qt5 on Sailfish
 
Python/PyOtherSide support in Jolla Harbour Store since January 7th 2015 was confirmed in "#mer-meeting: SailfishOS, open source, collaboration meeting: 7-January 2015" :
Quote:

4.b continue: Starting from today 7. Jan 2015 our Harbour QA team allows new the following libraries: libssl, libcrypto, liblzma, libxml2, libogg, libvorbis, QtGraphicalEffects. Also allowed is now the QML import: io.thp.pyotherside which allows QML modules written in Python. (iekku, 15:46:42)
I've updated the Sailfish/Python Development wiki page.

The together.jolla.com topic "Python application support in Jolla store (Harbour)" was updated :
Quote:

UPDATE: 09. Jan 2015
As mentioned in several places Harbour QA started on 07. Jan 2015 (with update 10, 1.1.1.27, Vaarainjärvi) to accept submissions which use Python QML plugins based on PyOtherSide.

gPodder and Perth Trains are among the first Python/PyOtherSide apps to be allowed in Harbour.

PS: We will update the Harbour FAQs soon :)
First Python softwares in Jolla Store, visible for all Sailfish users :
- gPodder 4.4.0 in January 8th 2015;
- Perth Trains 0.9.6 in January 9th 2015.

rcolistete 2015-01-10 19:25

Re: Python & Qt5 on Sailfish
 
Tutorial "Create and build Python app for Sailfish" in german.
With a "Dummy Project for Sailfish OS" source code in GitHub as a simple example of Python app for Sailfish OS.
It was announced in Twitter.

jcharpak 2015-01-10 23:35

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by rcolistete (Post 1456167)

First Python softwares in Jolla Store, visible for all Sailfish users :
- gPodder 4.4.0 in January 8th 2015;
- Perth Trains 0.9.6 in January 9th 2015.

Congratulations Thp (and I'm guessing mattaustin)!

EmaNymton 2015-01-14 16:16

Re: Python & Qt5 on Sailfish
 
Is there any way to offer translation for a pure PyOtherSide/QML application?

EmaNymton 2015-01-15 10:45

Re: Python & Qt5 on Sailfish
 
Ok, I found a way that worked for me!

If you use sailfish-qml to start your PyOtherSide/QML application you have to place your qm-translation files in a folder called translations.

Translation files are supposed to be named "<appname>-<lang>.qm" in "/usr/share/<appname>/translations/"

That works for me, found it at the source code of sailfishlib project:
https://github.com/sailfish-sdk/libs...shapp_priv.cpp

forestbird 2015-03-22 21:14

Re: Python & Qt5 on Sailfish
 
Hello.

I've tried to install PyQt on Jolla, but got the error about failed dependencies:

"Qt5Multimedia.WIdgets.so.5 is needed by python-pyqt-5.1.1-1.armv7hl"

And the same error occurs while trying to install Panucci.

Is there a way to install the missing module?

MartinK 2015-07-18 15:18

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by otsaloma (Post 1477111)
Any advice on how to handle translations of strings in Python code? In particular when doing string formatting in Python and the unformatted string should be subject to translation.

Is there a way to access ts-file data from Python without importing some huge PyQt? Or am I just wrong to put strings in Python and should move them all to QML? The whole Qt translation system seems very primitive compared to gettext.

https://github.com/otsaloma/poor-maps/issues/1

What about using gettext for the Python part and the Qt thing for the QML part ?

marmistrz 2016-08-07 11:25

Re: Python & Qt5 on Sailfish
 
Why is Jolla so reluctant to support PyQt5 in Harbour?

MartinK 2016-08-07 11:35

Re: Python & Qt5 on Sailfish
 
Quote:

Originally Posted by marmistrz (Post 1511933)
Why is Jolla so reluctant to support PyQt5 in Harbour?

Maybe because it's so much larger than PyOtherSide ? PyQt attepmts to wrap and make accessible all Qt 5 classes while PyOtherSide is just a light RPC interface for QML.

In any case it would be a good idea to raise the issue on the Community Meeting. :)

MartinK 2017-01-29 23:11

Re: Python & Qt5 on Sailfish
 
I've just submitted a merge request for updating PyOtherSide in Sailfish OS from 1.4 to 1.5:
https://git.merproject.org/mer-core/...rge_requests/2

If it is accepted by maintainers it these are the main features that will be available to Python application developers:
  • Support for OpenGL rendering in Python using PyOpenGL >= 3.1.0
  • New QML components: PyGLArea, PyFBO
  • pythonVersion() now returns the runtime Python version
  • Add the library to PYTHONPATH for standard library appended as .zip (except on Windows)
  • Call PyDateTime_IMPORT as often as necessary (Fixes #46)
  • Added pyotherside.format_svg_data for using SVG data in the image provider
  • Handle converting QVariantHash to Python dict type
  • Added .qmltypes file to provide metadata information for Qt Creator
  • New functions importNames() and importNames_sync() for from-imports

MartinK 2017-04-24 14:15

Re: Python & Qt5 on Sailfish
 
My PyOtherSide update request (to version 1.5.1) has been merged, and should be (according to Larstiq on IRC) part of the Sailfish OS Update that comes after the next one (2.1.0 + 2 updates). So let's hope the Sailfish OS update cycle speeds up now that Qt 5.6 is in and we can soon make use of all the nice new features and fixes of the updated PyOtherSide. :)


All times are GMT. The time now is 01:47.

vBulletin® Version 3.8.8