Coder Social home page Coder Social logo

erriez / pyside6-nuitka-deployment Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 139 KB

Pyside6 application deployment via Nuitka

Home Page: https://github.com/Erriez/pyside6-nuitka-test

License: MIT License

Python 100.00%
deployment executable github-actions linux nuitka pyside6 windows gui python qt

pyside6-nuitka-deployment's Introduction

PySide6 application build and release Licence MIT Pyside6 Open issue

Pyside6 Deployment Example

This is a Pyside6 example project using Nuitka build for Windows and linux with Github Actions. Other operating systems are not supported by the developer of this repository.

Pyside6 app screenshot

Qt recommends Nuitka or Pyinstaller to create Pyside6 executables for deployment. Nuitka creates smaller executables compared with Pyinstaller, but Pyinstaller build is faster.

Download executables created by Github Action

Download executables for Windows or Linux from:

Linux installer:

No sudo rights are required as the executable is installed in the user's home directory ~/.local/bin/erriez/:

# Add executable flag after download with command:
$ chmod +x erriez-pyside6-app-linux-setup.run
 
# Run setup:
$ ./erriez-pyside6-app-linux-setup.run

Press `q` to quit license.
Please type y to accept, n otherwise: y
...

Start the application via desktop menu | Accessories.

Linux standalone application:

The Linux standalone executable can be started directly without sudo or installation:

# Add executable flag after download with command:
$ chmod +x erriez-pyside6-app
 
# Start executable:
$ ./erriez-pyside6-app

Windows::

  • Run erriez-pyside6-app.exe as portable standalone application, or:
  • Run erriez-pyside6-app-setup.exe to install on Windows (default: C:\Program Files\Erriez\) which creates a shortcut in the start menu and desktop:

Build executable manually

# Clone project
$ git clone https://github.com/Erriez/pyside6-nuitka-deployment.git
$ cd pyside6-nuitka-deployment

# Install Linux system dependencies
$ sudo apt install python3-virtualenv ccache clang patchelf

# Create virtual environment
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ pip install nuitka

Build executable on Ubuntu/Mint 22.04/22.10 Desktop manually

Create single executable for Linux:

# Build executable for Linux
$ python3 -m nuitka \
    --output-dir=dist \
    --output-file=pyside6-app-linux \
    --onefile \
    --enable-plugin=pyside6 \
    --include-data-dir=images=images \
    main.py

# Start created executable
$ ./pyside6-app-linux

Build executable on Windows 10/11 Desktop manually

# Fix virtualenv issues
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

# Build executable for Windows
> python -m nuitka `
    --output-dir=dist `
    --output-file=pyside6-app.exe `
    --onefile `
    --assume-yes-for-downloads `
    --enable-plugin=pyside6 `
    --include-data-dir=images=images `
    --disable-console `
    --windows-icon-from-ico=images/app.ico `
    --company-name="Erriez Open Source Software" `
    --product-name="PySide6 App" `
    --file-version="1.0.0.0" `
    --product-version="`1.0.0.0" `
    --file-description="PySide6 Example App" `
    --copyright="MIT (c) 2023 by Erriez" `
    main.py

# Start created executable
> dist\pyside6-app.exe

Build Windows executable with pyinstaller manually

# https://pypi.org/project/pyinstaller-versionfile/
> pip install pyinstaller pyinstaller-versionfile
> create-version-file --outfile version_info.txt version_info.yaml
> pyinstaller `
    --distpath dist `
    --name pyside6-app-pyinstaller.exe `
    --noconfirm `
    --onefile `
    --noconsole `
    --ico images\app.ico `
    --add-data "images;images" `
    --version-file version_info.txt `
    main.py

Build Windows MSI manually

  • Download NSIS v3.
  • Download NSIS Quick Setup Script Generator.
  • Start NSIS Quick Setup Script Generator.exe and fill-in the wizard.
  • Copy generated file from Output\App\*.nsi to install.nsi and change to relative path / customize file.

Version numbering

Manual version updates are required in:

  • CHANGELOG.md
  • Git tag in format vx.x.x

False positives virusscanners

Windows Defender and virusscanners such as https://www.virustotal.com/ shows false positives when building executable with Pyinstaller or Nuitka. This is a known issue.

MIT License

This project is published under MIT license with an additional end user agreement (next section).

End User Agreement πŸ‡ΊπŸ‡¦

End users shall accept the End User Agreement holding export restrictions to Russia to stop the WAR before using this project.

pyside6-nuitka-deployment's People

Contributors

erriez avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.