aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/wheel_override.py
Commit message (Collapse)AuthorAgeFilesLines
* Python-3.10: Allow the new syntax for Python 3.9Christian Tismer2024-06-201-0/+1
| | | | | | | | Add a future statement to all Python source files. Task-number: PYSIDE-2786 Change-Id: Icd6688c7795a9e16fdcaa829686d57792df27690 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Android Deployment: Build wheels with macOS hostShyamnath Premnadh2024-06-031-1/+1
| | | | | | | | | | | | - Additionally, also move setting Python_SOABI manually for Android to where FindPython CMake module is called. This also aids in naming the wheel correctly. Pick-to: 6.7 Task-number: PYSIDE-2766 Change-Id: I73c089d31e2ee629f3ed676965fca27d53882110 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build_scripts: remove unused importsCristián Maureira-Fredes2022-12-191-1/+0
| | | | | | | | | | Many leftovers from the pathlib migration patches. Pick-to: 6.4 Change-Id: I7126fadbe45dbb387bc8948ba777cb690f10a758 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* wheels: use cp37 instead of cp36Cristián Maureira-Fredes2022-10-241-1/+1
| | | | | | | | | | | After removing the remaining mentions of Python 3.6 the wheels were still being generated with the cp36-abi3. Pick-to: 6.4 6.4.0 Change-Id: Icf06173a42c616f817bb428a50ab08a3a01ba705 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* pathlib: migrate build_scripts away from os.pathCristián Maureira-Fredes2022-10-181-1/+2
| | | | | | | | | There is a usage of os.path.relpath that cannot be migrated to pathlib, which remain the only usage of os.path Task-number: PYSIDE-2080 Change-Id: Iac781e9c9324fb8b9d3559b4225912d56782072a Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: rename DistUtilsCommandMixin to CommandMixinCristián Maureira-Fredes2022-10-131-5/+5
| | | | | | | | Renamed to avoid confusion related to distutil usage. Task-number: PYSIDE-2079 Change-Id: Idf6a8b64835be34a1e92032bd3b18b8eafe28e3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: replace distutils.log by simple loggerCristián Maureira-Fredes2022-10-131-4/+3
| | | | | | | | | | Adding simple logger based on the logging module to replace the distutils.log one. Task-number: PYSIDE-2079 Change-Id: I2a4996a57be701552005b57d2b1a251b9fc44c41 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* replace osx referencesCristián Maureira-Fredes2022-10-131-2/+2
| | | | | | | | | replacing them by macOS Pick-to: 6.4 Change-Id: Ic6a135406375ab1f0ebed3e63ba17423a34f13cb Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Regression: use explicit unpackShyamnath Premnadh2022-07-071-1/+1
| | | | | | | | | | Amends 4f37d045e03af7481b41b06fb53b56cb8062c56c Pick-to: 6.2 6.3 Change-Id: Id4134b41124c2fb29a57e2615e3b50c11c495c05 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* build: use explicit unpackCristián Maureira-Fredes2022-06-291-5/+4
| | | | | | | | | Avoid accessing elements from sequences by index without being explicit about all the returns from functions. Pick-to: 6.2 6.3 Change-Id: I1cddda7f8c38724907cad854ee99489058dae5f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-271-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* flake8: fix style issues to build_scripts/Cristián Maureira-Fredes2022-04-131-7/+9
| | | | | | Pick-to: 6.3 Change-Id: Ie56b054ca32869a488356b31eea49cc985fc463e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: update wheel namesCristián Maureira-Fredes2022-03-301-27/+24
| | | | | | | | | | | | - Removing extra cpX arguments from the wheel name - Use PEP600 to include the glibc version on the wheel name, instead of manylinux1. - Use 'abi3' on windows instead of 'none', because it's already supported on Windows Change-Id: I312586b72d38f2c5c4835ba5040d064e44c80e29 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* flake8: improve codestyling of build scriptsCristián Maureira-Fredes2022-03-221-5/+5
| | | | | | | | | | | - Fixing f-strings - Fixing indentation of some lines - Removing unused variables and imports - Changing the way of verifying if sphinx is installed Change-Id: I3f361759682324c9b0c9d33c24583435f137f05a Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Add support for cross-buildingAlexandru Croitor2022-02-041-26/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup.py can now be used to cross-compile PySide to a target Linux distribution from a Linux host. For example you could cross-compile PySide targeting an arm64 Raspberry Pi4 sysroot on an Ubuntu x86_64 host machine. Cross-compiling PySide has a few requirements: - a sysroot to cross-compile against, with a pre-installed Qt, Python interpreter, library and development packages (which provides C++ headers) - a host Qt installation of the same version that is in the target sysroot - a host Python installation, preferably of the same version as the target one (to run setup.py) - a working cross-compiling toolchain (cross-compiler, linker, etc) - a custom written CMake toolchain file - CMake version 3.17+ - Qt version 6.3+ The CMake toolchain file is required to set up all the relevant cross-compilation information: where the sysroot is, where the toolchain is, the compiler name, compiler flags, etc. Once are requirements are met, to cross-compile one has to specify a few additional options when calling setup.py: the path to the cmake toolchain file, the path to the host Qt installation and the target python platform name. An example setup.py invocation to build a wheel for an armv7 machine might look like the following: python setup.py bdist_wheel --parallel=8 --ignore-git --reuse-build --cmake-toolchain-file=$PWD/rpi/toolchain_armv7.cmake --qt-host-path=/opt/Qt/6.3.0/gcc_64 --plat-name=linux_armv7l --limited-api=yes --standalone Sample platform names that can be used are: linux_armv7, linux_aarch64. If the auto-detection code fails to find the target Python or Qt installation, one can specify their location by providing the --python-target-path=<path> and --qt-target-path=<path> options to setup.py. If the automatic build of the host shiboken code generator fails, one can specify the path to a custom built host shiboken via the --shiboken-host-path option. Documentation about the build process and a sample CMake toolchain file will be added in a separate change. Implementation details. Internally, setup.py will build a host shiboken executable using the provided host Qt path, and then use it for the cross-build. This is achieved via an extra setup.py sub-invocation with some heuristics on which options should be passed to the sub-invocation. The host shiboken is not included in the target wheels. Introspection of where the host / target Qt and Python are located is done via CMake compile tests, because we can't query information from a qmake that is built for a different architecture / platform. When limited API is enabled, we modify the wheel name to contain the manylinux2014 tag, despite the wheel not fully qualifying for that tag. When copying the Qt libraries / plugins from the target sysroot in a standalone build, we need to adjust all their rpaths to match the destination directory layout of the wheel. Fixes: PYSIDE-802 Task-number: PYSIDE-1033 Change-Id: I6e8c51ef5127d85949de650396d615ca95194db0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move from distutils to setuptoolsCristián Maureira-Fredes2021-11-261-1/+1
| | | | | | | | | | This is motivated by the deprecation of distutils, and removal in future versions https://github.com/pypa/packaging-problems/issues/127 Pick-to: 6.2 Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Python 3.10: add wheel identifierCristián Maureira-Fredes2021-09-281-1/+1
| | | | | | | Pick-to: 6.2 Pick-to: 6.2.0 Change-Id: I97b323d5055c30f782f62b85e734eb9f0e33f7b3 Reviewed-by: Simo Fält <simo.falt@qt.io>
* build_scripts: use f-strings instead of format()Cristian Maureira-Fredes2021-01-041-2/+2
| | | | | | | Pick-to: 6.0 Change-Id: I165e9a39f968f67f9eae3a632739908d5f8fda59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* build_scripts: replace print by distutils.logCristian Maureira-Fredes2021-01-041-3/+3
| | | | | | Pick-to: 6.0 Change-Id: I1106598719b48650847b08637e0caf6677cb26a0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build_scripts: remove unused importsCristian Maureira-Fredes2021-01-041-1/+0
| | | | | | Pick-to: 6.0 Change-Id: I8a62512707b576ea79fff56779322c7e38bbb21b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-2/+2
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build_scripts: remove references to python 2Cristian Maureira-Fredes2020-10-271-6/+5
| | | | | | | | | * Removing all the special cases for Python 2.7 * Removing Python >=3 conditions * Keeping Python 3.6+ as the allowed Python Change-Id: Ie48cafe952ae7a11bea997da2a35e7df5fea9a44 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove wheel.pep425tags importsCristian Maureira-Fredes2020-10-261-18/+19
| | | | | | | | | | | The import was removed starting from v0.35 in favor of the packaging module and other functions that are not placed in 'bdist_wheel'. Pick-to: 5.15 Fixes: PYSIDE-1385 Change-Id: I97f5dbf9867f779a897d9041489831255ea54b67 Reviewed-by: Simo Fält <simo.falt@qt.io>
* Fix wheel_override error when wheel not availableCristian Maureira-Fredes2020-10-141-8/+9
| | | | | | | | | | | | | Since the try failed, there was no option to import DistUtilsCommandMixin and then a: NameError: name 'DistUtilsCommandMixin' is not defined and AttributeError: type object 'type' has no attribute 'user_options' was raised. Task-number: PYSIDE-807 Change-Id: If5aa37ce9928a5c029b21decc24bd2bccf9b4dc4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Show options in command helpFriedemann Kleint2020-10-141-2/+7
| | | | | | | | | | | | 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: Remove constructor parameters depending on options from ↵Friedemann Kleint2020-10-061-14/+8
| | | | | | | | | | | | | PysideBuildWheel Constructor parameters depending on option values create a problem for introducing per-command option parsing. To fix this, split utility functions used by the commands in main.py and PysideBuildWheel into a separate wheel_utils.py Task-number: PYSIDE-807 Change-Id: Idabd3ba03726d2284e80234fc8485b70e6eb20ca Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Fix check for limited APIFriedemann Kleint2020-10-061-1/+2
| | | | | | | | Check for "yes"/"no", consistently. Task-number: PYSIDE-807 Change-Id: Id9f2ba125acb9ea8e811fd6cb5994bbb070605de Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* support Python 3.9Christian Tismer2020-08-191-1/+1
| | | | | | | | | | | This was merged with "WIP: Enable support for Python 3.9". There were minor problems, only. Thanks Cristian for adding cosmetic changes which should already have been applied in Python 3.8 or earlier. Change-Id: Id5e8696d9cfb7192243ad44c93e9f2cf347d6a7c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix machinery and pep425tags CI errorCristián Maureira-Fredes2020-01-271-2/+11
| | | | | | | | | | | | | | | Currently the Shiboken macro only handles AttributeError but when 'machinery' is not found inside 'importlib' that case also needs to be handle by the except clause. Adding ImportError will allow us to get access to the Python suffixes that we need to build. Additionally, some old versions of Python (2.7.14) require an "archive_root" parameter on the 'wheel.pep425tags.get_supported' function, which is not required in new versions (2.7.16, and 3+). Change-Id: Icc6e7d1e9384ea01eec9281586f7ca988e3eb649 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace OPTION_* by a dictionaryCristián Maureira-Fredes2019-12-031-3/+3
| | | | | | | | | | | | 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-8/+9
| | | | | | | | | | | | | | | | | - 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>
* Add support for Python 3.8Cristián Maureira-Fredes2019-10-241-1/+1
| | | | | Change-Id: I824085342694ac1cddc4db91dc6b95abdcc78122 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Include manylinux1 in package name for python2 builds on LinuxSimo Fält2018-07-111-7/+9
| | | | | Change-Id: I777cf3bd4f060610782fe6a09acd0e10ef713f0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Minimize the wheel_override diffChristian Tismer2018-07-021-130/+132
| | | | | | | | | | | | | | | | | | | | | | For some shortcomings of bdist_wheel, it was necessary to write a modified wheel version. This patch reorders the parts a bit and avoids extra indentation to make it easier to compare the resulting diff to bdist_wheel.py with a simple compare tool like sublimerge. The semantics of the patch is not changed at all. The patch itself can be best inspected using a diff tool which ignores whitespace. ----- We should consider to submit a patch to python.org that has the necessary improvements for the wheel format, so we can get rid of this file. Change-Id: I1f54ad7cb93d64b57462311e5334c906e27d84a0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Prepare Limited API for Python 3.7Christian Tismer2018-06-261-1/+1
| | | | | | | | | | | | | | | PySide has successfully been tested with the Python 3.7 branch. There will be no change in the areas that are important for us. It is then safe to bump the supported version and the limited API version checks to fully include Python 3.7. The macro errors in the limited API was fixed by a pull request, but it was too late to get it into 3.7rc1. The error workaround was therefore extracted into pep384_issue33738.cpp and will be deactivated later. Change-Id: Iec3f277b02cac03a5cf44cbcf955ddc690c112e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Current limited API packages won't work on Python 3.7 and 3.8Alexandru Croitor2018-06-061-1/+1
| | | | | | | | | | | | | This is intentional, because of verification code regarding Python buffers. So instead of lying, we remove those python version bits from the generated package name, aka instead of "cp35.cp36.cp37.cp38" it is now only "cp35.cp36". Change-Id: I2891f64e93821d3a3ccb693f28576c34d1365606 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Include manylinux1 in package name for limited API builds on LinuxAlexandru Croitor2018-05-311-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | PyPI only accepts binary Linux packages that are built conforming to PEP 513 / manylinux1 support. The gist of it is that extensions need to be built on CentOS 5, so that they work on most newer distro versions than that. Official Qt can't be built on such an old distro. The minimum requirement is thus CentOS / RHEL 7 (which we used for packaging Qt 5.11.0 on Coin). We do want to upload packages to PyPI, so we have to resort to including "manylinux1" in the name. Currently this is tied to the limited API option. TODO: In the future we should name packages "manylinux1" only when the distro version is acceptable for Qt build requirements (RHEL 7.x). It might get a bit messy though, due to platform.linux_distribution being deprecated, and the necessity to depend on the new "distro" package. Change-Id: Ic4dfccd87d810360cbbfce72b27d5fa31e2a59dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Adjust wheel names when building with limited apiAlexandru Croitor2018-05-311-0/+186
Wheel has poor support for naming wheel packages that were built with limited API enabled. We need to override some of bdist_wheel's methods to generate a correct name and correct metadata. Move the pyside_bdist_wheel class into a separate file, and implement the necessary logic. Change-Id: I23d814cbb794052fb18a1e018f7b767c60945254 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>