diff --git a/.gitignore b/.gitignore index 0cfa5f0..b8593cf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /qtquicktests/qtquicktests /qtquicktests/target_wrapper.sh /examples/__pycache__ +/docs/_build diff --git a/LICENSE b/LICENSE index 294a3dd..78de1e9 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 ISC License -Copyright (c) 2011, 2013-2020, Thomas Perl +Copyright (c) 2011, 2013-2022, Thomas Perl Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/docs/conf.py b/docs/conf.py index b6ed951..c677293 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,16 +41,16 @@ master_doc = 'index' # General information about the project. project = u'PyOtherSide' -copyright = u'2014-2020 Thomas Perl' +copyright = u'2014-2022 Thomas Perl' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '1.5' +version = '1.6' # The full version, including alpha/beta/rc tags. -release = '1.5.9' +release = '1.6.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index e6ba875..6d72a6f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,7 @@ and continuation-passing style function calls. Qt 6 Support ============ -.. versionadded:: UNRELEASED +.. versionadded:: 1.6.0 PyOtherSide now supports Qt 6 while retaining source compatibility with Qt 5. @@ -1192,186 +1192,11 @@ pass a suitable ``python-config`` to ``qmake`` at configure time: Alternatively, you can edit ``python.pri`` manually and specify the compiler flags for compiling and linking against Python on your system. -Building for Android --------------------- - -There is no Python or Qt present by default and both need to be shipped with the application. - -The current solution can be summarized like this: - -1. Statically cross-compile Python 3 for Android using the Android NDK -2. Statically compile PyOtherSide against the Android Python build and bundle the Python standard library inside the PyOtherSide binary -3. Use the Qt 5 SDK to make a QtQuick application - the SDK will handle bundling of your application file and of the PyOtherSide binary automatically - -A more detailed guide follows. It describes how to get from the source code of the relevant components to being able to run an Android application -with a Qt Quick 2.0 GUI running on an Android device. The `gPodder` podcast aggregator serves as (full featured & fully functional!) example of such an application. - -Performed in this environment: - - * Fedora 20 - * Qt 5.3.1 Android SDK - * latest Android SDK with API level 14 installed - * OpenJDK 1.7 - * a few GB of harddrive space - * an Android 4.0+ device connected to the computer that is accessible over ``adb`` (eq. the debugging mode is enabled) - -*This is just one example environment where these build instructions have been tested to work. Reasonably similar environments should work just as well.* - -The build is going to be done in a folder called ``build`` in the users home directory, -lets say that the use is named ``user`` (replace accordingly for your environment). - -We start in the home directory: - -.. code-block:: sh - - mkdir build - cd build - -Now clone the needed projects, load submodules and switch to correct branches. - -.. code-block:: sh - - git clone --branch fixes https://github.com/thp/python3-android - git clone https://github.com/thp/pyotherside - git clone --recursive https://github.com/gpodder/gpodder-android - -Next we will build Python 3 for Android. This will first download the Android NDK, then Python 3 source code, followed by crosscompiling the Python 3 code for Android on ARM. -*NOTE that this step alone can require multiple GB of harddisk space.* - -.. code-block:: sh - - cd python3-android - make all - -As the next step we modify the ``python.pri.android`` file to point to our Python build. If should look like this as a result (remember to modify it for your environment): - -.. code-block:: qmake - - QMAKE_LIBS += -L/home/user/build/python3-android/build/9d-14-arm-linux-androideabi-4.8/lib -lpython3.3m -ldl -lm -lc -lssl -lcrypto - QMAKE_CXXFLAGS += -I/home/user/build/python3-android/build/9d-14-arm-linux-androideabi-4.8/include/python3.3m/ - -Then copy the file over the python.pri file in the PyOtherSide project directory: - -.. code-block:: sh - - cd .. - cp python3-android/python.pri.android pyotherside/python.pri - -PyOtherSide can also help us ship & load the Python standard library if we can provide it a suitable zip bundle, which can be created like this: - -.. code-block:: sh - - cd python3-android/build/9d-14-arm-linux-androideabi-4.8/lib/python3.3/ - zip -r pythonlib.zip * - cd ../../../../.. - -For PyOtherSide to include the packed Python standard library it needs to be placed in its src subfolder: - -.. code-block:: sh - - mv python3-android/build/9d-14-arm-linux-androideabi-4.8/lib/python3.3/pythonlib.zip pyotherside/src/ - -PyOtherSide will then use the qrc mechanism to compile the compressed standard library during inside it's own binary. This removes the need for us to handle its shipping & loading ourself. - -Next you need to build PyOtherSide with QtCreator from the Qt 5.3 Android SDK, so make sure that the Qt 5.3 Android kit is using the exact same NDK that has been used to build Python 3 for Android. To do that go to *settings*, find the *kits* section, select the Android kit and make sure that the NDK path points to: - -``/home/user/build/python3-android/sdk/android-ndk-r9d`` - -Next open the pyotherside/pyotherside.pro project file on QtCreator, select the Android kit and once the project loads go to the *project view* and make sure that under *run* the API level is set to 14 (this corresponds to Android 4.0 and later). The Android Python 3 build has been built for API level 14 and our PyOtherSide build should do the same to be compatible. - -Also make sure that shadow build is disabled, just in case. - -Once done with the configuration got to the *build* menu and select the *built pyotherside* option - this should build PyOtherSide for Android and statically compile in our Python build and also include the Python standard library zip file with qrc. - -As the next step we need to move the PyOtherSide binary to the QML plugin folder for the Qt Android SDK, so that it can be fetched by the SDK when building gPodder. - -Let's say we have the SDK installed in the ``/opt`` directory (default for the Qt SDK installer on Linux), giving us this path to the plugin folder: - -``/opt/Qt5.3/5.3/android_armv7/qml`` - -First create the folder structure for the pyotherside plugin: - -.. code-block:: sh - - mkdir -p /opt/Qt5.3/5.3/android_armv7/qml/io/thp/pyotherside - -Then copy the pyotherside binary and *qmldir* file to the folder: - -.. code-block:: sh - - cp pyotherside/src/libpyothersideplugin.so /opt/Qt5.3/5.3/android_armv7/qml/io/thp/pyotherside/ - cp pyotherside/src/qmldir /opt/Qt5.3/5.3/android_armv7/qml/io/thp/pyotherside/ - -Next open the gPodder project in QtCreator (gpodder-android/gpodder-android.pro) and again make sure the Android kit is selected, that the API level 14 is used and that *shadow build* is disabled. Then just press the *Run* button and the SDK should build an Android APK that includes the libpyotherside binary (it fetched automatically from the plugins directory because is referenced in the gPodder QML source code) and deploy it to the device where gPodder should be started. - -.. _gPodder: http://gpodder.org/ - -Building for Windows --------------------- - -On Windows (tested versions: Windows 7), you need to download: - -1. Qt 5 (VS 2010) from `qt-project.org downloads`_ (tested: 5.2.1) -2. `Visual C++ 2010 Express`_ with `SP1`_ -3. Python 3 from `python.org Windows downloads`_ (tested: 3.3.4) - -We use VS 2010 instead of MinGW, because the MinGW version of Qt depends on -working OpenGL driver, whereas the non-OpenGL version uses Direct3D via ANGLE. -Also, Python is built with Visual C++ 2010 Express (see `Compiling Python on -Windows`_), so using the same toolchain when linking all three components (Qt, -Python and PyOtherSide) together makes sense. - -The necessary customizations for building PyOtherSide successfully on Windows -have been integrated recently, and are available since PyOtherSide 1.3.0. - -.. _qt-project.org downloads: http://qt-project.org/downloads -.. _Visual C++ 2010 Express: http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4 -.. _SP1: https://www.microsoft.com/en-US/download/details.aspx?id=23691 -.. _python.org Windows downloads: http://python.org/downloads/windows/ -.. _Compiling Python on Windows: http://docs.python.org/devguide/setup.html#windows-compiling - -Once these pre-requisites are installed, you need to make some customizations -to the build setup: - -1. In ``src/qmldir``: Change ``plugin pyothersideplugin`` to ``plugin - pyothersideplugin1``. This is needed, because on Windows, the library - version gets encoded into the library name. - -2. In ``python.pri``: Modify it so that the Python 3 ``libs/`` folder is - added to the linker path, and link against ``-lpython33``. Also, modify - it so that the Python 3 ``include/`` folder is added to the compiler flags. - -Example ``python.pri`` file for a standard Python 3.3 installation on Windows: - -.. code-block:: qmake - - QMAKE_LIBS += -LC:\Python33\libs -lpython33 - QMAKE_CXXFLAGS += -IC:\Python33\include\ - -With the updated ``qmldir`` and ``python.pri`` files in place, simply open -the ``pyotherside.pro`` project file in Qt Creator, and build the project. -Configure a **Release Build**, and *disable* **Shadow Builds**. - -To install PyOtherSide into your Qt installation, so that the QML import works -from other projects: - -1. Make sure the PyOtherSide project is opened in Qt Creator -2. In the left column, select **Projects** -3. Make sure the **Run** tab (Run Settings) of your project is selected -4. In **Deployment**, click **Add Deploy Step** and select **Make** -5. In the **Make arguments:** field, type ``install`` -6. Hit **Run** to install PyOtherSide in your local Qt folder -7. Dismiss the "Custom Executable" dialog that pops up - -Known Problems: - -* **Qt Resource System** importing might not fully work on Windows - ChangeLog ========= -Version UNRELEASED (YYYY-MM-DD) +Version 1.6.0 (2022-08-05) ------------------------------- * Support for **Qt 6** (Qt 5 is still supported for now) @@ -1379,6 +1204,7 @@ Version UNRELEASED (YYYY-MM-DD) from the converter are now valid as long as the ``PyObject`` is alive (previously they were valid until the next string conversion or until converter was destroyed) * Fixed ``image_loader`` and ``imageprovider_svg_data`` examples +* Removed outdated build instructions for Android and Windows Version 1.5.9 (2020-01-17) -------------------------- diff --git a/pyotherside.pri b/pyotherside.pri index dda9092..6060380 100644 --- a/pyotherside.pri +++ b/pyotherside.pri @@ -1,2 +1,2 @@ PROJECTNAME = pyotherside -VERSION = 1.5.9 +VERSION = 1.6.0 diff --git a/src/converter.h b/src/converter.h index 302dc60..3b5a152 100644 --- a/src/converter.h +++ b/src/converter.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/pyobject_converter.h b/src/pyobject_converter.h index 9a9c48c..f76f9f3 100644 --- a/src/pyobject_converter.h +++ b/src/pyobject_converter.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/pyotherside_plugin.cpp b/src/pyotherside_plugin.cpp index 0833a5d..98070bc 100644 --- a/src/pyotherside_plugin.cpp +++ b/src/pyotherside_plugin.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/pyotherside_plugin.h b/src/pyotherside_plugin.h index f03a3c1..daaeb59 100644 --- a/src/pyotherside_plugin.h +++ b/src/pyotherside_plugin.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qml_python_bridge.h b/src/qml_python_bridge.h index deda144..3699800 100644 --- a/src/qml_python_bridge.h +++ b/src/qml_python_bridge.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython.cpp b/src/qpython.cpp index 6817582..3445891 100644 --- a/src/qpython.cpp +++ b/src/qpython.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython.h b/src/qpython.h index 1e4a56d..7cc78c0 100644 --- a/src/qpython.h +++ b/src/qpython.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_imageprovider.cpp b/src/qpython_imageprovider.cpp index f1871ba..b0709da 100644 --- a/src/qpython_imageprovider.cpp +++ b/src/qpython_imageprovider.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_imageprovider.h b/src/qpython_imageprovider.h index 145b31e..c7733ed 100644 --- a/src/qpython_imageprovider.h +++ b/src/qpython_imageprovider.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_priv.cpp b/src/qpython_priv.cpp index fd548dc..4a78fd2 100644 --- a/src/qpython_priv.cpp +++ b/src/qpython_priv.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_priv.h b/src/qpython_priv.h index ce8c470..7d6d456 100644 --- a/src/qpython_priv.h +++ b/src/qpython_priv.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_worker.cpp b/src/qpython_worker.cpp index b3f3a37..5a8176e 100644 --- a/src/qpython_worker.cpp +++ b/src/qpython_worker.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qpython_worker.h b/src/qpython_worker.h index b904fd2..b0f8c0a 100644 --- a/src/qpython_worker.h +++ b/src/qpython_worker.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/qvariant_converter.h b/src/qvariant_converter.h index fdf2e67..e0b0ebc 100644 --- a/src/qvariant_converter.h +++ b/src/qvariant_converter.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tests/tests.cpp b/tests/tests.cpp index 87295a1..f102a20 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tests/tests.h b/tests/tests.h index b73610c..cd11d60 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -1,7 +1,7 @@ /** * PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 and Qt 6 - * Copyright (c) 2011, 2013-2020, Thomas Perl + * Copyright (c) 2011, 2013-2022, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above