diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-07-20 18:54:05 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-10-12 14:45:35 +0000 |
commit | 43fe3494a9d902034896e3afa7b5158c77163be0 (patch) | |
tree | 07bbd20b8bd322fdf062b87dfade1e1e74d80433 /README.pyside2.md | |
parent | c6c9f057cddc0e0b885a648489264538eba0a158 (diff) |
Allow building shiboken2 and PySide2 as separate wheels
Actually this creates 3 wheel packages:
- shiboken2 (the python module and libshiboken shared library)
- shiboken2-generator (contains the generator executable, libclang and
dependent Qt libraries)
- PySide2 (the PySide2 modules and Qt shared libraries, and tools like
rcc, uic)
Calling the setup.py script will not do the actual build now (in the
sense of calling CMake, make, etc.). Instead it will spawn new
processes (via subprocess.call) calling the same setup.py script,
but with different arguments. These "sub-invocations" will do the
actual building. Thus, the "top-level invocation" will decide which
packages to build and delegate that to the "sub-invocations" of
setup.py.
A new optional command line argument is introduced called
"--build-type" which defaults to "all", and can also be set to
"shiboken2", "shiboken2-generator" and "pyside2". A user can choose
which packages to build using this option. The "top-level invocation"
uses this option to decide how many "sub-invocations" to execute.
A new command line argument called "--internal-build-type"
takes the same values as the one above. It defines which package
will actually be built in the new spawned "sub-invocation" process.
The "top-level invocation" sets this automatically for each
"sub-invocation" depending on the value of "--build-type".
This option is also useful for developers that may want to debug the
python building code in the "sub-invocation".
Developers can set this manually via the command line, and
thus avoid the process spawning indirection.
A new class Config is introduced to facilitate storage of
the various state needed for building a single package.
A new class SetupRunner is introduced that takes care of the
"--build-type" and "--internal-build-type" argument handling
and delegation of "sub-invocations".
A new class Options is introduced to 'hopefully', in the future, streamline
the mess of option handling that we currently have.
setup.py now is now simplified to mostly just call
SetupRunner.run_setup().
Certain refactorings were done to facilitate further clean-up of the
build code, the current code is definitely not the end all be all.
Various other changes that were needed to implement the wheel
separation:
- a new cmake_helpers directory is added to share common cmake
code between packages.
- the custom popenasync.py file is removed in favor of using
subprocess.call in as many places as possible, and thus
avoid 10 different functions for process creation.
- Manifest.in is removed, because copying to the setuptools
build dir is now done directly by prepare_packages functions.
- because prepare_packages copies directly to the setuptools
build dir, avoiding the pyside_package dir, we do less copying
of big Qt files now.
- versioning of PySide2 and shiboken2 packages is now separate.
shiboken2 and shiboken2-generator share the same versions for
now though.
- shiboken2 is now listed as a required package for PySide2, to
facilitate pip requirements.txt dependencies.
- coin_build_instructions currently needs to install an unreleased
version of wheel, due to a bug that breaks installation of
generated wheel files.
- added separate command line options to pyside2_config.py for
shiboken2-module and shiboken2-generator.
- adapted samplebinding and scriptableapplication projects due to
shiboken being a separate package.
- adapted pyside2-tool and shiboken2-tool python scripts for setup
tools entry points.
- made some optimizations not to invoke cmake for shiboken2-generator
when doing a top-level "all" build.
- fixed unnecessary rpaths not to be included on Linux (mainly the
Qt rpaths).
Task-nubmer: PYSIDE-749
Change-Id: I0336043955624c1d12ed254802c442608cced5fb
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'README.pyside2.md')
-rw-r--r-- | README.pyside2.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/README.pyside2.md b/README.pyside2.md new file mode 100644 index 000000000..cde05940d --- /dev/null +++ b/README.pyside2.md @@ -0,0 +1,53 @@ +# PySide2 + +### Introduction + +PySide is the [Python Qt bindings project](http://wiki.qt.io/PySide2), providing +access to the complete Qt 5.x framework as well as to generator tools for rapidly +generating bindings for any C++ libraries. + +The PySide project is developed in the open, with all facilities you'd expect +from any modern OSS project such as all code in a git repository and an open +design process. We welcome any contribution conforming to the +[Qt Contribution Agreement](https://www.qt.io/contributionagreement/). + + +PySide 2 supports Qt5. For building, please read about +[getting started](https://wiki.qt.io/PySide2_GettingStarted). +Then download the sources by running + + git clone https://code.qt.io/pyside/pyside-setup + +### Building + +#### Dependencies + +PySide versions following 5.6 use a C++ parser based on +[Clang](http://clang.org/). The Clang library (C-bindings), version 3.9 or +higher is required for building. Prebuilt versions of it can be downloaded from +[download.qt.io](http://download.qt.io/development_releases/prebuilt/libclang/). + +After unpacking the archive, set the environment variable *LLVM_INSTALL_DIR* to +point to the folder containing the *include* and *lib* directories of Clang: + + 7z x .../libclang-release_39-linux-Rhel7.2-gcc5.3-x86_64.7z + export LLVM_INSTALL_DIR=$PWD/libclang + +On Windows: + + 7z x .../libclang-release_39-windows-vs2015_64.7z + SET LLVM_INSTALL_DIR=%CD%\libclang + +#### Build Instructions + +You might consider using a virtual environment as described at +[getting started](https://wiki.qt.io/PySide2_GettingStarted). +You should be able to build: + + cd pyside-setup + python setup.py install + +The setup script will try to find the location of the qmake tool of the Qt +version to be used and the cmake build tool in the path. Non-standard +locations can be specified by the *--qmake=path_to_qmake* or +*--cmake=path_to_cmake* command line options. |