aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/doc/deployment.rst
blob: f33e3cac08c6e068db519695ccb8db610b64f5c1 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|project| 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.

Here are a few distribution options that you could use:
 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 into a single binary file or a directory.

If you choose the **third** option, consider using one of these tools:
 * `fbs`_
 * `PyInstaller`_
 * `cx_Freeze`_
 * `py2exe`_
 * `py2app`_

.. _fbs: https://build-system.fman.io/
.. _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/

|project| is a cross-platform framework,
so we would like to focus on solutions that work on the three
major platforms supported by Qt: Linux, macOS, and Windows.
The following table summarizes the platform support for those packaging
tools:

.. raw:: html

    <table class="docutils align-default">
      <thead>
        <tr>
          <th class="head">Name</th>
          <th class="head">License</th>
          <th class="head">Linux</th>
          <th class="head">macOS</th>
          <th class="head">Windows</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><p>fbs</p></td>
          <td><p>GPL</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
        </tr>
        <tr>
          <td><p>PyInstaller</p></td>
          <td><p>GPL</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
        </tr>
        <tr>
          <td><p>cx_Freeze</p></td>
          <td><p>MIT</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: green;">yes</p></td>
        </tr>
        <tr>
          <td><p>py2exe</p></td>
          <td><p>MIT</p></td>
          <td><p style="color: red;">no</p></td>
          <td><p style="color: red;">no</p></td>
          <td><p style="color: green;">yes</p></td>
        </tr>
        <tr>
          <td><p>py2app</p></td>
          <td><p>MIT</p></td>
          <td><p style="color: red;">no</p></td>
          <td><p style="color: green;">yes</p></td>
          <td><p style="color: red;">no</p></td>
        </tr>
      </tbody>
    </table>

According to this table, only *fbs*, *cx_Freeze*, and *PyInstaller*
meets our cross-platform requirement.

As these are command-line tools, it could be hard to include
resources to your application, such as images, icons, and
meta-information. This means, you will need special hooks
or scripts to handle them before adding to the package.
In addition to this, these tools does not offer a mechanism
to update your application packages.

To create update packages, use the `PyUpdater <https://www.pyupdater.org/>`_,
which is built around PyInstaller.

The `fbs`_ tool offers a nice UI
that allows the user to install the application step-by-step.

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

.. note::

   Deployment is supported only from Qt for Python 5.12.2 and later.

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

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