Skip to content

Switch back to released PyInstaller #7806

@toofar

Description

@toofar

In #7803 we are changing our PyInstaller dependency to pull in a version from their develop branch, rather than a released version. We had to put in place a workaround to get that working. This issue is to track reverting those workarounds once a new major version (6.0+) is out.

Currently these commits are the ones to revert, they are around recompiling the bootloader in CI (leaving them there probably wouldn't break anything, technically). Hopefully the commit IDs are still correct (check the PR linked above):

Already reverted commits:
commit 8a327beb17dbe97cc8022549d652f72eb2996c97
Author: toofar <toofar@spalge.com>
Date:   Sun Jul 30 12:22:44 2023 +1200

    tox: disable pip cache for pyinstaller environment
    
    The build_release script which calls pyinstaller now sets
    PYINSTALLER_COMPILE_BOOTLOADER=true which is used when building the
    wheel. On ci the build_release script runs in a tox env which also
    installs pyinstaller (something about updating version info on windows).
    So by the time the pyinstaller venv is built there is already a cached
    pyinstaller wheel. This commit disables that cache so the wheel should
    always be rebuilt.
    
    It looks like we can't put arbitrary pip CLI args in `deps` anymore. And
    I couldn't get install_command to inherit from the parent env (I tried
    `{[testenv]install_command} --no-cache-dir`) so had to reproduce the
    command I observed with `tox -vv`.
    
    Alternatives:
    * set the env var in the tox config (is the manual build done via tox
      anyway? In that case there's no point in trying to move the env var
      into the script anyway)
    * set the env var in the workflow config (and pass through in tox) -
      doesn't help with the manual build case which is the reason for moving
      the env var into the script anyway
    
    This should be reverted once a pyinstaller 6 release is out.

diff --git a/tox.ini b/tox.ini
index 36814b8203e9..d80f1ce3259d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -190,6 +190,8 @@ passenv =
     PYINSTALLER_COMPILE_BOOTLOADER
 setenv =
     qt5: PYINSTALLER_QT5=true
+install_command =
+    python -I -m pip install --no-cache-dir {opts} {packages}
 deps =
     -r{toxinidir}/requirements.txt
     -r{toxinidir}/misc/requirements/requirements-pyinstaller.txt

commit dd86483065a81726e3ce70ec9fab7389c12efeb4
Author: toofar <toofar@spalge.com>
Date:   Thu Jul 27 21:09:11 2023 +1200

    Move PYINSTALLER_COMPILE_BOOTLOADER into build script
    
    Previously this was being set in tox which means that if you run build_release
    manually, not via tox, it won't be set. So this commit moves the env var to be
    set in the build_release script when pyinstaller is being invoked.
    I'm not actually sure how the manual builds are done though, maybe they are
    done via tox too.
    
    This should be reverted once a pyinstaller 6 release is out.

diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index f602cae43250..b2af109832b7 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -81,6 +81,7 @@ def call_tox(
     env['PATH'] = os.environ['PATH'] + os.pathsep + str(python.parent)
     if debug:
         env['PYINSTALLER_DEBUG'] = '1'
+    env['PYINSTALLER_COMPILE_BOOTLOADER'] = 'true'
     subprocess.run(
         [sys.executable, '-m', 'tox', '-vv', '-e', toxenv, *args],
         env=env, check=True)
diff --git a/tox.ini b/tox.ini
index af59910f2080..36814b8203e9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -269,7 +269,6 @@ passenv = *
 # Override default PyQt6 from [testenv]
 setenv =
     qt5: QUTE_QT_WRAPPER=PyQt5
-    PYINSTALLER_COMPILE_BOOTLOADER=true
 usedevelop = true
 deps =
     -r{toxinidir}/requirements.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: infrastructureIssues related to development scripts, CI, servers, etc.priority: 2 - lowIssues which are currently not very important.

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions