aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Split and move various setup.py parts into different filesAlexandru Croitor2018-04-301-1075/+0
| | | | | | | | | | | | | | | | | This is an initial effort to clean up setup.py. A new directory called build_scripts contains most of the logic for building, leaving setup.py as an entry point. The build_scripts directory contains the usual qtinfo, utils, and the setup.py content has been split into main.py and platform specific files under platforms subfolder. The testrunner script has been modified to find the new location of the utils module. Task-number: PYSIDE-558 Change-Id: I3e041d5116ca5c3f96c789317303b65a7b1bbd70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace 'osx' with 'macos' in installation scriptsAlexandru Croitor2018-04-251-13/+13
| | | | | Change-Id: Ibe5412edb6467594c5d2fd80545d9e1572a286cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fail early in setup.py when clang can not be foundAlexandru Croitor2018-04-201-3/+4
| | | | | | | | | | | | | | | Previously only a warning was printed when clang could not be found at setup.py time, resulting in a not very nice to parse CMake error. Make sure to fail early in setup.py if clang can not be found. Also make sure to check that the clang source variable0 is not "None", because passing "None" to run_process_output results in an even more obscure Python error. Change-Id: Ia94bf7da51996a3d9c74d5d9978b1bf9e26b03d5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Reformat and remove of trailing spaces from filesCristian Maureira-Fredes2018-04-191-130/+192
| | | | | | | | Continuing the 72/79 reformatting with the remaining Python files. Change-Id: I4fc0abd720326a16ed4b2d431fd703de71fe02e9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-03-051-4/+31
|\ | | | | | | Change-Id: I452d3a0a04e282b678879132ca1b3a272910ef04
| * Implement proper package versioningAlexandru Croitor2018-03-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is inspired by / follows PEP 440 for handling version numbers and also takes into account the Qt versioning scheme. PySide2 as package name will stay as-is (not renamed to PySide5). Release versions would have the following pattern: PySide2 5.x.y (e.g. 5.6.3) Package (wheel) name would also contain the bundled Qt version, e.g.: PySide2-5.6.0-5.6.4-cp27-cp27m-macosx_10_7_intel.whl Pre-release versions would look like: PySide2 5.6.0a1, 5.6.0a2, 5.6.0b1, 5.6.0b2, 5.6.0rc1, etc. Development (snapshot) versions would look like: PySide2 5.6.0-dev123456789 (last part is timestamp of build time) All of the examples above comply with the PEP 440 rules. In the example above where the Qt version is specified as part of the wheel package name ("5.6.4"), the Qt version is not part of the package version itself, because it doesn't comply with PEP 440. But it does comply with wheel package names (PEP 427), and by that PEP's definitions, it will be the optional "build tag" part of the file name, which is preceded by the actual package version, and followed by the python version / abi tag. Implementation: This change defines two new python configuration files which will be the authoritative source for the shiboken and PySide2 libraries, as well as the final PySide2 package itself: sources/shiboken/shiboken_version.py sources/pyside2/pyside_version.py The pyside_version.py file will be the source of the final package version. The shiboken and PySide2 version should be modified in sync, when bumping the version of the package before a release. The reason for having both files instead of 1, is to make life easier for developers that might extract only shiboken from the repository. If at some point shiboken and PySide2 CMake projects get merged into one project, the duplicate version files would go away. The version files are parsed by CMake to correctly name the shared libraries (and SO versions), and they are also read by the setup.py script, to generate correct package metadata and a correct package (wheel) name. This change also removes the broken dist targets from PySide2's and shiboken's CMakelists files, which depended on some version suffix which was never set in setup.py. PEP440: https://www.python.org/dev/peps/pep-0440/ PEP427: https://www.python.org/dev/peps/pep-0427/ Change-Id: I3226460b1adf2555c8711fa2ba47c223b957cb44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Improve packaging on WindowsAlexandru Croitor2018-03-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of the packaging rules on Windows were outdated (Qt4 times). This change does a couple of things to improve the process: - Removes attempts of copying files matching Qt4 naming patterns - Fixes filters to copy Qt dlls / pdbs for a single build configuration (only debug dlls, or only release dlls depending on which configuration was used when building PySide2). As a result this reduces the total size of the package. - Removes some comments that are outdated. - Simplifies pdb copying logic. - Adds a bit of whitespace between copying rules, for easier navigation. Change-Id: Icc06398f524f0249504750c718f97b61ffadf7df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Improve macOS minimum deployment target decision processAlexandru Croitor2018-03-021-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of asking the user to specify a minimum macOS deployment target, setup.py will now query the value from qmake. A user can still specify a custom value if they wish to do so. This simplifies building on the CI, meaning there is no need to hardcode the minimum deployment targets per branch. Task-number: PYSIDE-603 Task-number: PYSIDE-606 Change-Id: I55c79dc643b5a2b59d0e65add132c581fb6fc7f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-091-9/+221
|\| | | | | | | Change-Id: I7ff12fd3c9ac969cbbbbe4d520d6f55b572b4de8
| * Embeds $ORIGIN rpath into QtCore and libICU librariesAlexandru Croitor2018-02-061-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case if Qt is configured without "-R ." which adds the $ORIGIN rpath value, the linker will not try to find the copied over ICU libraries (because the RPATH of a library higher in the dependency tree does not get inherited by its children). We want to make sure that the linker does attempt to find the ICU libraries in the destination Qt libdir, so we prepend the additional rpath value to the QtCore library, and also to the ICU libraries. Change-Id: Idbbf578d58ee12806b61610e6fd21f7c1ac48e3d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Improve libICU deployment on LinuxAlexandru Croitor2018-02-061-23/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the --standalone build process would download and extract an archive of ICU libraries, regardless of which ICU Qt was built against. The build process will now detect which ICU libraries QtCore depends on and copy the libraries over to the destintation libdir. Something similar might be needed in the future for macOS and Windows. Change-Id: I0db0c8c628d3c095a8a4a1e361f8fafe18da2ec3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-01-121-0/+23
|\| | | | | | | Change-Id: I18387b329e61646e8d68e678140b533281e359cd
| * Extract iculibs for linux standalone wheelSimo Fält2018-01-111-0/+21
| | | | | | | | | | | | | | | | | | When creating PIP wheel for linux from Qt CI binaries we have to include ICU libs among Qt binaries. Change-Id: I30adf7041784cf3558c064d6ab6ad295ed1f5551 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-271-36/+72
|\| | | | | | | Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
| * Make standalone option work on LinuxAlexandru Croitor2017-11-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes were made to copy the correct Qt shared libraries into the package (updated to Qt5 naming). A new rpath value will be inserted alongside $ORIGIN, to point to the copied over libraries. Also because symlinks are not supported by wheels, the actual Qt libraries have to be copied instead of the symlinks. Change-Id: I656a89a0b0136a290752bca141125bdeb5bb44d5 Task-number: PYSIDE-558 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Make standalone option work on macOSAlexandru Croitor2017-11-151-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements standalone option on macOS, both for .dylib Qt build and framework build. Multiple rules are applied to figure out which files need to be copied into the final package. We also take care to embed a proper LC_RPATH for the PySide libraries, so that they point to the copied over Qt libraries. Change-Id: I442749e7c2318a66a22e3a1dd0ae703fb8943acf Task-number: PYSIDE-558 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix rpath handling on macOSAlexandru Croitor2017-11-151-30/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change ultimately allows running python scripts that use PySide2 without setting DYLD_LIBRARY_PATH / DYLD_FRAMEWORK_PATH. It is achieved by embedding a @loader_path LC_RPATH into all PySide shared libraries, so that they can load each other if they have dependencies. Also an additional LC_RPATH is embedded to point to the Qt libraries directory which was used for building PySide2. A new option "--rpath='your_value'" is available to allow manually specifying the rpath value to be embedded into the libraries. Change-Id: Id783196e908877692312b1d40fef4ad0b09f3e68 Task-number: PYSIDE-558 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Use latest version of llvm-configFriedemann Kleint2017-11-031-1/+33
| | | | | | | | | | | | | | | | | | | | When falling back to llvm-config, try to determine the most recent version by using a glob pattern to find the executable (llvm-config-3.8/3.9...) and checking the version it reports. Change-Id: I13b5aff09a6a2f8b95def0041176c1487749be1a Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Replace _ARCH_ by 64/32bit in LLVM_INSTALL_DIRFriedemann Kleint2017-09-221-0/+3
| | | | | | | | | | | | Task-number: PYSIDE-431 Change-Id: I6d4ea037ab0c524f305ed72f95745deb410b8971 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-06-091-3/+22
|\| | | | | | | Change-Id: I73f39966a2af7aa935e1890e29c9b71573aae97c
| * utils: Handle SymlinksFriedemann Kleint2017-06-091-3/+22
| | | | | | | | | | | | | | | | | | Try to recreate the .so version symlinks correctly on Linux instead of copying the files. Task-number: PYSIDE-526 Change-Id: I3b015efe4f2f57abe418f171a8631d194ed08f65 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | testrunner.py/Windows: Add Clang to the pathFriedemann Kleint2017-06-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | It is required for shiboken's ApiExtractor tests. Move subroutine detectClang into utils.py for usage by testrunner.py/setup.py. Task-number: PYSIDE-431 Change-Id: I9f1984ea9fc9857ad3e7fddf621884fdc96ef52f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix licensesFriedemann Kleint2017-04-051-0/+39
|/ | | | | | | | | | | | | | | | | | Fix license checker error messages when run in default mode (git ls-files in pyside-setup): Failed test '.../pyside-setup/header.LGPL re-defines a license of type LGPL originally defined in .../qtbase/header.LGPL' not ok 2 - docs/conf.py does not appear to contain a license header not ok 3 - docs/make.bat does not appear to contain a license header not ok 4 - ez_setup.py does not appear to contain a license header not ok 5 - popenasync.py does not appear to contain a license header not ok 7 - qtinfo.py does not appear to contain a license header not ok 11 - utils.py does not appear to contain a license header Task-number: PYSIDE-491 Change-Id: Ia10ff40ef39c64ac717f36ed073b1d1675a150d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix run_process_output to work with Python 3Alexandru Croitor2016-09-201-1/+1
| | | | | | | | Strings are already encoded as utf8, so there is no need to call decode on them. Change-Id: Idfaaa5f5092fb6010ea64b7abf754d7b343d07e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Make prepareSubModules() a bit smarterFriedemann Kleint2016-09-161-0/+10
| | | | | | | | | | | | Avoid unnecessarily re-initializing the submodules and checking out branches. In a first loop, collect the subdirectories and check whether any are missing. Initialize submodules only in that case. In the second loop, check out the correct branch if it differs. Change-Id: I3c16fd9b7bd6feb77b7b921d61f7e622cfab797f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pyside-setup: Print directory in run_process().Friedemann Kleint2016-05-111-2/+1
| | | | | | | Change-Id: Iaa22b81c4e18e2490cedc547443a58680cd7764b Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* fix an old installer error with rpath.Christian Tismer2015-06-271-5/+11
| | | | | | This bug is old, but showed up after I tried to build parts of PySide for Qt5. Problem: There are rpath entries which don't trigger creation of an rpath command. This can be seen when Qt is not linked, and qtcore has an explicit path.
* Remove the need to use the post-install script on Mac OS platform and ↵Christian Tismer2015-06-201-1/+137
| | | | update the docs.
* Remove the need to use the post-install script on Linux platform by patching ↵Roman Lacko2014-12-051-3/+7
| | | | the rpath at build time + exclude patchelf executable from binary distribution
* Fix bug in utils.copydir when no destination directory is created.Paul Romano2014-09-091-21/+22
|
* Re-generate examples Qt resource files for Python 3 compatibility when ↵Roman Lacko2014-04-211-0/+20
| | | | preparing binary packages
* Code cleanupRoman Lacko2013-08-201-49/+42
|
* Properly initialize Windows SDK environment via SetEnv.cmd. Prefer Visual ↵Roman Lacko2013-08-051-3/+66
| | | | C++ environment script if exists (vcvars32/64.bat)
* Removed --msvc-version option. Required MSVC compiler version is now ↵Roman Lacko2013-08-011-41/+22
| | | | resolved from python interpreter version
* Support for building windows binaries with only Windows SDK installed ↵Roman Lacko2013-07-131-22/+80
| | | | (Visual Studio is no more required)
* Fixed missing importRoman Lacko2013-07-121-0/+1
|
* Fix path updates to not store the lower() version of the original path values.Robin Dunn2013-06-031-1/+1
|
* Remove unused codeRoman Lacko2013-05-211-17/+5
|
* Return only installed vcvarsall.bat when searching vcvarsall.bat in systemRoman Lacko2013-05-051-1/+3
|
* Fixed "develop" setuptools command + fixed building on windows when msvc ↵Roman Lacko2013-04-301-0/+56
| | | | environment was not properly initialized.
* Support for building windows binaries outside Visual Studio Command Prompt ↵Roman Lacko2013-04-251-2/+9
| | | | using the --msvc-version option. The MSVC environment is now properly initialized by setup script.
* Introduce option --msvc-version to specify version of MSVC compiler. Use ↵Roman Lacko2013-04-251-5/+64
| | | | that optition to get MSVC environment variables.
* Fix missing WindowsError on POSIX platformsRoman Lacko2013-04-191-0/+5
|
* Don't copy empty folders in copydir() functionRoman Lacko2013-04-191-3/+2
|
* Show info about the running process in logRoman Lacko2013-03-251-10/+12
|
* Don't use custom popenasync module on linux to run commands. This fixes ↵Roman Lacko2012-09-071-1/+12
| | | | following error: can't concatenate bytes to None
* Introduced new command line options --version and --list-versionsRoman Lacko2012-07-311-0/+26
|
* use standard string format function instead of custom implementationRoman Lacko2012-07-161-16/+9
|
* new --standalone option, when enabled, package qt libs on linuxRoman Lacko2012-06-071-0/+6
|
* Initial commit (copy of lck/pyside-dist repo)Roman Lacko2012-06-041-0/+177