aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/setup_runner.py
Commit message (Collapse)AuthorAgeFilesLines
* setup.py: Pass --reuse-build only to commands that use DistUtilsCommandMixinDmitry Shachnev2020-12-091-1/+1
| | | | | | | | | | | Other commands, such as configure, do not support it. Amends 0a00958b083008dea340ef78b0f235ca49b7d22c. Change-Id: I5dbcea6aea60e027a8ff15d10351edbeaefdf338 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b12c71b9c1fd9723f30329dc8c16a63d4e5eb80b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* setup.py: Fix 'clean' commandFriedemann Kleint2020-11-241-1/+6
| | | | | | | | | | | | Do not add -reuse-build, which it cannot handle. Amends ff5a96c49e2aa5347c1c9892aad33c591e931639. Task-number: PYSIDE-807 Change-Id: I96ab03b95dd7762b1a16f2acc5d8ca31555ef1a3 Reviewed-by: Alexander Volkov <avolkov@astralinux.ru> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 0a00958b083008dea340ef78b0f235ca49b7d22c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build scripts: Fix warning about import orderFriedemann Kleint2020-11-091-3/+1
| | | | | | | | | | | Import Setuptools before Distutils, fixing: distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first. Change-Id: Ibbc1a5cd1d348f6f44f7e80a3ba7e9a7341fae8e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b70183a78ed7a478ae9f2af19bd84535a8e69320) Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Show options in command helpFriedemann Kleint2020-10-141-3/+5
| | | | | | | | | | | | Move some options to a command mixin. This cannot be done for all options since some determine the package name and need to be known at before instantiating the commands. Print an additional help text listing them. Fixes: PYSIDE-807 Change-Id: I43adb09db16f74af037bfb754cad2c0f5cfe43be Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Fix some flake8 warningsFriedemann Kleint2020-10-071-0/+1
| | | | | | | Fix spaces around operators, missing lines, import order. Change-Id: I05ecafec849578fed6018654fcefaa008b6801e8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Do not display help multiple timesFriedemann Kleint2020-10-061-1/+5
| | | | | | | | Run only the pyside build when help is requested. Task-number: PYSIDE-807 Change-Id: I0aa5bf2db0a6a7e6e32a66357efd200af70dd653 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Clean the build/install output a bitCristián Maureira-Fredes2020-06-081-1/+5
| | | | | | | | | | | | * Adding STATUS or WARNING to a couple of message() calls. * Replacing some print() by log.info() * Changing some '*' by '-' * Align configuration outputs to check paths easily * Adding big message to check when shiboken2/pyside2 is being built. * Including the cmake_minimum_required() function instead of an 'if'. Change-Id: Idb6c5797286d400192d083403063e2ae582e3fe6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace OPTION_* by a dictionaryCristián Maureira-Fredes2019-12-031-5/+4
| | | | | | | | | | | | Currently we are importing * from the options.py file, which is a problem for the linters to discover if we are properly using the options of the file. Having a dictionary provides also a better way of access these options, and it is more clean than having one variable per each option. Change-Id: Ie70bd88665357b85e2842c5df269857504ecccdf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve code style with flake8Cristián Maureira-Fredes2019-11-251-1/+3
| | | | | | | | | | | | | | | | | - We agreed on 100 columns time ago, so I move around a few things, - Removing unused modules, - Fix white-spaces tabs without being multiple of 4, - Encourage the use of os.path.join when joining paths, - Using .format() for string formatting, - Remove white-spaces from default arguments, - Adjusting white-spaces before inline comments, - Adding extra newlines when expected, - Adjust spaces for lines under-indented for visual indent, - Remove white-spaces from parenthesis, and adding them for arithmetic operators. Change-Id: I9cb28cefd114d63580b584a063c452f90d3ca885 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Fix running under non-UTF8 localeFriedemann Kleint2019-01-161-1/+1
| | | | | | | | | | Redirecting stderr to stdout causes an error when running under non-UTF8 locales. For the build scripts, it is also not desired to mix the output channels, so, remove the redirection. Change-Id: I6e3d05ede00537c3cc4c022780e8d0ed27bb0cad Fixes: PYSIDE-880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make quiet builds really quietAlexandru Croitor2018-12-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change does a couple of things: - Sets the distutils / setuptools --verbose option to 0 - Sets the distutils / setuptools --quiet option to 1 - The options above end up calling distutils.log.set_verbosity(0) - Passes the QUIET_BUILD cmake option from setup.py to every CMake invocation, when --quiet is passed to setup.py - Sets the CMAKE_INSTALL_MESSAGE variable to silence messages regarding installation of files - Sets the CMAKE_RULE_MESSAGES variable to disable progress report in makefiles when building each source file - Overrides the CMake message function, not to display STATUS / info / untyped messages (still displays warnings and errors) - Changes the build / install elapsed time messages to always be printed even in quiet mode - Reverts the previously introduced set_quiet function in utils, because log.set_verbosity() now takes care of silencing those messages As a result, there's a lot less clutter when doing a quiet build. Warnings, errors and shiboken output is still displayed. Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Don't redirect stderr to stdout by default when calling setup.pyAlexandru Croitor2018-10-181-1/+1
| | | | | Change-Id: I49b7491be9649979f9f9487e983bdc4be355de07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Allow building shiboken2 and PySide2 as separate wheelsAlexandru Croitor2018-10-121-0/+165
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>