<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>(please make sure to send a copy to the mailing list when replying, your answer is kept below for better readability).</div><div><br></div><div>first of all, I'm no PySide2 dev, just a user, so I can't comment on all your points. I'm just working on a similar project and can give you hints on how we solved these issues there.</div></blockquote><div><br></div><div>Thank you very much, I also want to link my project with pyside. Thank you for notation about mail list recipients!</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yes I think this is true - your bindings will not be compatible to future or past shiboken2/PySide2 releases. Or maybe a PySide2 dev make a different statement?<br></blockquote><div> </div><div>I also spoke with Cristián Maureira in telegram chat, and, as I understand him, the main goals for compatibility is using <a href="http://itanium-cxx-abi.github.io/cxx-abi/">http://itanium-cxx-abi.github.io/cxx-abi/</a> cxx-abi. In this case, my libs will be compatable with Qt binaries. But, him also were recommend me ask my question in other community places, like mailing list )</div><div>But, there is no proven way and this is very upsetting to me (</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Well, I use a specific QT version to compile and link against, but this version is not used during runtime in the python interpreter. During runtime, the shared libraries published with pyside2 and shiboken2 are used from the python environment. Therefore the extra caution with importing the PySide2 libs before importing the bindings. Note that due to different distributions and virtual environments, it is not easily possible to provide RPATH's for safely linking against pyside2 and shiboken2 libs.</div></blockquote><div><br></div><div>I got example from Cristián Maureira with example of CMake project - <a href="https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/scriptableapplication/CMakeLists.txt">https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/scriptableapplication/CMakeLists.txt</a>. There is you can see cmake functions for linking with pyside2 libraries, and this can solve our problems if we will can build with the same environment as pyside2. </div><div>But, there is no ways for building in the same environment with pyside2 python package, as I understand. Therefore, I can compile with pyside2 my lib only in local, devel environment, but not a production.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Probably they are not really compatible with the python manylinux conventions (but PySide2 itself is not either, see the manlinux1 thread). The manylinux binary distributions use old compilers and old libs to provide binary compatibility. Same is done for QT binary distributions, but with slightly different assumptions. manylinux2014 and Qt5.x assumptions are sufficiently similar from my experience, though.</div></blockquote><div><br></div><div>Ok, good suggestion! But, which compiler is actual? Clang or gcc? Which compiler flags I need to set? ) <br></div><div><br></div><div>Thank you for answering!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">сб, 2 мая 2020 г. в 18:14, <<a href="mailto:icfwm@gmx.net">icfwm@gmx.net</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>(please make sure to send a copy to the
mailing list when replying, your answer is kept below for better
readability).</div>
<div><br>
</div>
<div>first of all, I'm no PySide2 dev, just
a user, so I can't comment on all your points. I'm just working on
a similar project and can give you hints on how we solved these
issues there.</div>
<div><br>
</div>
<div>
<div>> I need to follow by pyside2 releases and update my
dependcies each time.</div>
</div>
<div><br>
</div>
<div>Yes I think this is true - your
bindings will not be compatible to future or past
shiboken2/PySide2 releases. Or maybe a PySide2 dev make a
different statement?</div>
<div><br>
</div>
<div>
<div>> May be are there built envoronment descriptions for each
OS?</div>
<div>> I mean, like this:</div>
<div>> 1. Linux 32/64 bit, clang 8.0</div>
<div>> 2. Windows msvs2019</div>
<div>> 3. MacOS clang 8.0</div>
<div><br>
</div>
<div>I think you have to stick here to the conventions used for
binary python wheel distributions. Linux binary wheels should
comply to the respective manylinux PEP's. I think for windows
builds the python convention is to use the same MSVC version
which is used for building the python interpreter itself (see
here <a href="https://wiki.python.org/moin/WindowsCompilers" target="_blank">https://wiki.python.org/moin/WindowsCompilers</a> for a list).</div>
<div><br>
</div>
<div>
<div>> Also, I see another approach - I will link, due
compilation my, lib with publicated Qt binaries that were used
in pyside2. </div>
<div><br>
</div>
<div>Well, I use a specific QT version to compile and link
against, but this version is not used during runtime in the
python interpreter. During runtime, the shared libraries
published with pyside2 and shiboken2 are used from the python
environment. Therefore the extra caution with importing the
PySide2 libs before importing the bindings. Note that due to
different distributions and virtual environments, it is not
easily possible to provide RPATH's for safely linking against
pyside2 and shiboken2 libs.<br>
</div>
<div><br>
</div>
<div>
<div>> For example, I have linux binaries that were
compiled on gcc 8.3 and Qt 5.14.2 with the same compiler.
Are they compatable with pyside2 Qt binaries? Does users can
use my signals/slots with pyside2 lib?</div>
<div><br>
</div>
<div>Probably they are not really compatible with the python
manylinux conventions (but PySide2 itself is not either, see
the manlinux1 thread). The manylinux binary distributions
use old compilers and old libs to provide binary
compatibility. Same is done for QT binary distributions, but
with slightly different assumptions. manylinux2014 and Qt5.x
assumptions are sufficiently similar from my experience,
though. <br>
</div>
<div><br>
</div>
<div>Note that your dependencies in the example are
incomplete. You also use a shiboken2_generator version and
link against shiboken2 and pyside2 shared libraries when
compiling the python c extension.<br>
</div>
<div><br>
</div>
<div>It is possible to use signals / slots in shiboken2
generated bindings of external libraries.<br>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div>On 02.05.20 16:25, Михаил Миловидов
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<blockquote class="gmail_quote">
<p>It's not that bad. It's just shiboken2 and PySide2 for your
package plus shiboken2_generator for generating the
bindings. I wouldn't call this a nightmare.</p>
</blockquote>
<div>The developing flow is not hard, but the problem in
dependency environment.</div>
<div>I need to follow by pyside2 releases and update my
dependcies each time.</div>
<div>From other side, I still not understand how to provide
binary compatibility with my lib.</div>
<div><br>
</div>
<blockquote class="gmail_quote"> I guess you already found the
docker containers provided here <a href="https://github.com/pypa/manylinux" target="_blank">https://github.com/pypa/manylinux</a> for
generating binary python packages for linux. Other than that I
am not aware of more resources, I think you'd have to
integrate your library into a CI environment for your own.</blockquote>
<div>There is no problem with <b>developing</b>. </div>
<div>There is problem with <b>publicating</b> and <b>supporting</b>!</div>
<div>Of course, I can found docker container and hope that
pyside2 were built in the same, but what about Windows and
MacOS?</div>
<div>And, as I said before, I need to follow by changes in
pyside2 environment, but at this time this is not transparency
for me.</div>
<div><br>
</div>
<div>May be are there built envoronment descriptions for each
OS?</div>
<div>I mean, like this:</div>
<div>1. Linux 32/64 bit, clang 8.0</div>
<div>2. Windows msvs2019</div>
<div>3. MacOS clang 8.0</div>
<div><br>
</div>
<div>Also, I see another approach - I will link, due compilation
my, lib with publicated Qt binaries that were used in
pyside2. </div>
<div><br>
</div>
<div>I just still not understand, how to compile my python
package for pyside2 compatibility. </div>
<div>For example, I have linux binaries that were compiled on
gcc 8.3 and Qt 5.14.2 with the same compiler. Are they
compatable with pyside2 Qt binaries? Does users can use my
signals/slots with pyside2 lib?</div>
<div><br>
</div>
<div>Thank you for attention!</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">сб, 2 мая 2020 г. в 16:38,
<<a href="mailto:icfwm@gmx.net" target="_blank">icfwm@gmx.net</a>>:<br>
</div>
<blockquote class="gmail_quote">
<div>
<div><br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">Thank you for answering my question!
<div>Looks, like a dependency nightmare )</div>
</div>
</div>
</blockquote>
<p>It's not that bad. It's just shiboken2 and PySide2 for
your package plus shiboken2_generator for generating the
bindings. I wouldn't call this a nightmare.<br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div>Are there any shared build jobs for pyside2? I
mean, the jobs like CirclCI, TravisCI, Github
Actions, etc.</div>
<div>This would make creation python packages based on
pyside2 much easier.</div>
</div>
</div>
</blockquote>
<p>I guess you already found the docker containers provided
here <a href="https://github.com/pypa/manylinux" target="_blank">https://github.com/pypa/manylinux</a>
for generating binary python packages for linux. Other
than that I am not aware of more resources, I think you'd
have to integrate your library into a CI environment for
your own.<br>
</p>
<p><br>
</p>
<blockquote type="cite"><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">сб, 2 мая 2020 г. в
15:18, <<a href="mailto:icfwm@gmx.net" target="_blank">icfwm@gmx.net</a>>:<br>
</div>
<blockquote class="gmail_quote">
<div>
<div>
<div>Hi,</div>
<div><br>
</div>
<div>you have to use shiboken2 for creating the
bindings. In the bindings xml description, use
the options</div>
<div><br>
</div>
<div> <load-typesystem
name="typesystem_core.xml" generate="no" /><br>
<load-typesystem
name="typesystem_core_common.xml" generate="no"
/><br>
</div>
<div><br>
</div>
<div>for being able to use QtCore (the xml files
are part of PySide2). You will need the
shiboken2_generator package. I am using the
binary package provided at <a href="http://qt.io" target="_blank">qt.io</a>, even though
this is not really recommended.<br>
</div>
<div><br>
</div>
<div>From my understanding, PySide2 does not
maintain binary compatibility between minor
versions (this is different to the C++ Qt
library). This means that the bindings are valid
only for a specific PySide2 version (such as
5.14.2.1) and this specific version should be
set as a dependency in your setup.py. via <span>install_requires</span><span>=</span>[<span>"PySide2==5.14.2.1"</span>,
<span>"shiboken2==5.14.2.1"].<br>
</span></div>
<div><br>
</div>
<div>If you want to provide binary packages for
linux, you probably want to go the manylinux2014
path (see the manylinux1 discussion a few
threads above). I have had troubles to get
shiboken2_generator run correctly on this
platform, so my solution is to generate the
sources on a different linux system and compile
them on the manylinux2014 container.<br>
</div>
<div><br>
</div>
<div>You can use any binary compatible version of
QT for developing the library (e.g., 5.14.0).
However, when you load your library in python,
you have to ensure that the correct QT library
is loaded beforehand. Therefore, before
importing your bindings, you have to make sure
that PySide2.QtCore (and all other PySide2
modules) are imported before the bindings of
your lib.</div>
<div><br>
</div>
<div>You may want to have a look at my
work-in-progress package for reference: <a href="https://github.com/ifm/nexxT" target="_blank">https://github.com/ifm/nexxT</a>,
relevant portions are nexxT/src/cnexxT.xml and
nexxT/__init__.py (where QtCore is imported
before actually importing the bindings cnexxT).<br>
</div>
<div><br>
</div>
<div>Hope this helps</div>
<div>Christoph<br>
</div>
<div><br>
</div>
On 26.04.20 22:31, Михаил Миловидов wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I have open source project - <a href="https://marketplace.qt.io/collections/featured/products/daggy" target="_blank">https://marketplace.qt.io/collections/featured/products/daggy</a></div>
<div>I want to create python bindings for my lib
such as separate python package and publicate
it in pip.</div>
<div>The lib - <a href="https://github.com/synacker/daggy/tree/master/src/DaggyCore" target="_blank">https://github.com/synacker/daggy/tree/master/src/DaggyCore</a>)
- that I want to publicate based on Qt
framework and has signals/slots interface.</div>
<div>It means, that lib must be binary
compatable with pyside2 python package, for
using signals and slots.</div>
<div>I think, that this lib can give boost for
using Qt in python in non-gui cases, because
it gives solution that not exists on python:</div>
<div><a href="https://stackoverflow.com/questions/18322123/receiving-streaming-output-from-ssh-connection-in-python" target="_blank">https://stackoverflow.com/questions/18322123/receiving-streaming-output-from-ssh-connection-in-python</a><br>
</div>
<div><a href="https://stackoverflow.com/questions/57066148/streaming-python-command-executed-over-ssh-in-real-time" target="_blank">https://stackoverflow.com/questions/57066148/streaming-python-command-executed-over-ssh-in-real-time</a><br>
</div>
<div><a href="https://stackoverflow.com/questions/7680055/python-to-emulate-remote-tail-f" target="_blank">https://stackoverflow.com/questions/7680055/python-to-emulate-remote-tail-f</a><br>
</div>
<div><a href="https://stackoverflow.com/questions/18421757/live-output-from-subprocess-command" target="_blank">https://stackoverflow.com/questions/18421757/live-output-from-subprocess-command</a><br>
</div>
<div><a href="https://stackoverflow.com/questions/50612710/read-streaming-data-over-pipe-in-python" target="_blank">https://stackoverflow.com/questions/50612710/read-streaming-data-over-pipe-in-python</a><br>
</div>
<div><br>
</div>
<div>There are no direct ways for local or
remote data streaming and aggregation, but my
lib will offer to do this in simple way with
Qt signals/slot async model.</div>
<div>Therefore, I'm very motivated in python
bindings, but still not understand, how to
ensure binary compatibility with pyside2
python package.</div>
<div><br>
</div>
<div>Is there any tutorials, examples or may be
docker containers for building Qt lib python
bindings with the same envoronment, such as
pyside2 in pip?</div>
<div>At this time, I understand, how to compile
my Qt lib python bindings compatable with
pyside2 only for local compilation from
source, but don't understand how to ensure
compatibility with pyside2 from pip.</div>
<div><br>
</div>
<div>Thank you for attention!</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
PySide mailing list
<a href="mailto:PySide@qt-project.org" target="_blank">PySide@qt-project.org</a>
<a href="https://lists.qt-project.org/listinfo/pyside" target="_blank">https://lists.qt-project.org/listinfo/pyside</a>
</pre>
</blockquote>
<p><br>
</p>
</div>
_______________________________________________<br>
PySide mailing list<br>
<a href="mailto:PySide@qt-project.org" target="_blank">PySide@qt-project.org</a><br>
<a href="https://lists.qt-project.org/listinfo/pyside" rel="noreferrer" target="_blank">https://lists.qt-project.org/listinfo/pyside</a><br>
</blockquote>
</div>
</blockquote>
<p><br>
</p>
</div>
</blockquote>
</div>
</blockquote>
<p><br>
</p>
</div>
</blockquote></div>