Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1654

Reduce bloat with custom Python freezer

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P2: Important
    • 6.4.0
    • 6.1.1
    • PySide
    • None
    • All

    Description

      I've tried several different tools for deploying a frozen macOS bundle of my Qt application — py2app, pyinstaller, cx_Freeze — with variable degrees of success.

      My most recent app, which is relatively simple, has been packaged by cx_Freeze into a 240 megabyte executable. Inside the app bundle I found a gazillion Qt components my app doesn't need at all, and deleted them by hand, wholesale, without going into the details (I was pretty sure I didn't need anything related to 3D, OpenGL or Network, for example).

      This has reduced the app size by half to around 120mb, without any fine-tuning on my part. And it worked just fine afterwards. This is an amazing waste of space and is especially annoying when you have to quickly send a small tool to a few people by mail.

      Surely this is something that could be done automatically by a machine? Would it be possible for the Qt company to provide a tool for freezing PySide6 applications (for macOS but also other platforms), and including only what is needed to run the executable? This would make Qt & Python a great, fully-fledged alternative to Swift and AppKit, unbound to Apple proprietary software and suitable to developers of all levels of experience.

      Attachments

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            merkwurdichliebe Merkwurdichliebe GitHub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: