aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/doc/deployment.rst
blob: 582e389928bb8aa7dc4d5fe4f0f5a7ace4ee4041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
==========
Deployment
==========

Deploying or freezing an application is a crucial part of many Python projects.
Most large projects are not based on a single Python file, so
the distribution of these applications becomes more difficult.

The options for a project are:
 1. Sending a normal zip-file with the application's content.
 2. Building a proper `Python package (wheel) <https://packaging.python.org/>`_.
 3. Freezing the application in a single binary file, or into a directory.

For the **third** option, there are many available tools:
 * `PyInstaller <https://www.pyinstaller.org/>`_,
 * `cx_Freeze <https://anthony-tuininga.github.io/cx_Freeze/>`_,
 * `py2exe <http://www.py2exe.org/>`_,
 * `py2app <https://py2app.readthedocs.io/en/latest/>`_,

Since |project| is a cross-platform framework,
we would like to focus on solutions that at least work on
the three major platform supported by Qt: Linux, macOS, and Windows.

The following table summarizes the above mentioned tools support:

===========   =======   =====   =====   =======
Name          License   Linux   macOS   Windows
===========   =======   =====   =====   =======
py2exe        MIT       no      no      yes
py2app        MIT       no      yes     no
cx_Freeze     MIT       yes     yes     yes
PyInstaller   GPL       yes     yes     yes
===========   =======   =====   =====   =======

From the table we can see that only *cx_Freeze* and *PyInstaller*
meet our requirements.

All tools are command-line based, and it could become
a hard task to include more resources to your application, such as
images, icons, and meta-information, because you will need to create
special hooks or separate scripts to handle them.
Additionally, since this only
allows you to freeze your current application, you don't have
any mechanism to update your application.

To cover the update part, there is a tool built around PyInstaller
called `PyUpdater <https://www.pyupdater.org/>`_ which enables
a simple mechanism to ship applications updates.

On top of all these features, including also a nice interface
that allows the user to install the application step by step,
or even better, provide templates to create new projects to easily
freeze-them-up is something really beneficial for both developers
and end-users.
This is where `fbs <https://build-system.fman.io>`_ enters the
game, being based on PyInstaller, but including all the nice features
we previously mentioned.

Here you can find a set of tutorials on how to use the previously
described tools.

.. note:: Deployment is possible only in Qt for Python 5.12.2

.. toctree::
    :name: mastertoc
    :maxdepth: 2

    deployment-pyinstaller.rst
    deployment-cxfreeze.rst
    deployment-fbs.rst