Skip to content

Commit 76da1fb

Browse files
Documented the new command line interfaces.
1 parent 37b996f commit 76da1fb

File tree

4 files changed

+132
-187
lines changed

4 files changed

+132
-187
lines changed

doc/command_line.rst

Lines changed: 114 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -16,114 +16,50 @@ By convention project files have a ``.pdy`` extension.
1616
This will open the ``myproject.pdy`` project creating it if necessary.
1717

1818

19-
.. program:: pyqtdeploycli
19+
.. program:: pyqtdeploy-build
2020

21-
:program:`pyqtdeploycli`
22-
------------------------
21+
:program:`pyqtdeploy-build`
22+
---------------------------
2323

24-
:program:`pyqtdeploycli` implements a number of modes of operation that are
25-
usually used in automated build scripts. These modes are invoked by specifying
26-
an *action* as the only positional argument on the command line. The behaviour
27-
of an action may be modified by additional command line options.
28-
29-
The supported actions are:
30-
31-
.. cmdoption:: build
32-
33-
This will build all the source code, include the :program:`qmake` ``.pro``
34-
files, needed to create the application. The next step in the full build
35-
process would be to run :program:`qmake`.
36-
37-
.. cmdoption:: configure
38-
39-
This will create a configuration file for compiling a particular package
40-
for a particular target platform. The configuration file is used by the
41-
package's build system to create the package's Python bindings.
42-
43-
Configuration files are intended as a basis which will be fine for most
44-
cases. However you should check that they are appropriate for your
45-
particular case and modify them if necessary.
46-
47-
.. cmdoption:: install
48-
49-
.. versionadded:: 1.2
50-
51-
This will compile (if necessary) and install a particular package for a
52-
particular target platform. It is assumed that the recommended directory
53-
structure described in :ref:`ref-directory-structure` is being used.
54-
55-
At the moment only the ``python`` package for the ``win`` target is
56-
supported. It is assumed that you have installed Python using one of the
57-
Windows installers from ``python.org``.
58-
59-
.. cmdoption:: show-packages
60-
61-
This will display a list of packages that :program:`pyqtdeploycli` can
62-
create configuration files for.
63-
64-
.. cmdoption:: show-targets
65-
66-
This will display a list of targets that :program:`pyqtdeploycli` can
67-
create configuration files for.
68-
69-
.. cmdoption:: show-version
70-
71-
This will display the version number.
24+
:program:`pyqtdeploy-build` generates the target-specific source code,
25+
including the :program:`qmake` ``.pro`` files, needed to create the
26+
application. The next step in the full build process would be to run
27+
:program:`qmake`.
7228

7329
The full set of command line options is:
7430

75-
.. cmdoption:: -h, --help
31+
.. option:: -h, --help
7632

77-
This will display a summary of the command line actions and options.
33+
This will display a summary of the command line options.
7834

79-
.. cmdoption:: --android-api LEVEL
35+
.. option:: --build-dir DIR
8036

81-
.. versionadded:: 1.3
37+
``DIR`` is the name of the directory where all the application source code
38+
will be placed. The default value is ``build-`` followed by a
39+
target-specific suffix.
8240

83-
When used with the :option:`configure` action to configure the ``python``
84-
package for the ``android`` target this specifies the Android API level.
85-
The default value is obtained from the value of the
86-
:envvar:`ANDROID_NDK_PLATFORM` environment variable. If this is not set
87-
then ``9`` is used which is the default level used by Qt.
41+
.. option:: --include-dir DIR
8842

89-
.. cmdoption:: --disable-patches
90-
91-
.. versionadded:: 1.2
92-
93-
When used with the :option:`configure` action to configure the ``python``
94-
package this specifies that the Python source code will not be patched.
95-
The default is to enable the patching of the Python source code for Android
96-
based targets. Use this option when you want to apply your own set of
97-
patches, or if you are using an NDK (such as `CrystaX NDK
98-
<https://www.crystax.net>`__) that doesn't require the Python source code
99-
to be patched at all.
100-
101-
.. cmdoption:: --enable-dynamic-loading
102-
103-
When used with the :option:`configure` action to configure the ``python``
104-
package this specifies that the Python interpreter will have dynamic
105-
loading enabled. The default is to disable dynamic loading.
106-
107-
.. cmdoption:: --include-dir
108-
109-
.. versionadded:: 1.2
43+
``DIR`` is the name of the directory containing the target Python
44+
installation's ``Python.h`` file. It overrides any value specified in the
45+
project file.
11046

111-
When used with the :option:`build` action this specifies the name of the
112-
directory containing the target Python installation's ``Python.h`` file.
113-
It overrides any value specified in the project file.
47+
.. option:: --interpreter EXECUTABLE
11448

115-
.. cmdoption:: --interpreter
49+
``EXECUTABLE`` is the **host** Python interpreter used to compile all of
50+
the Python modules used by the application. It overrides any value
51+
specified in the project file.
11652

117-
.. versionadded:: 1.2
53+
.. option:: --no-clean
11854

119-
When used with the :option:`build` action this specifies the **host**
120-
Python interpreter used to compile all of the Python modules used by the
121-
application. It overrides any value specified in the project file.
55+
Normally the build directory is deleted and re-created before starting a
56+
new build. Specifying this option leaves any existing build directory as
57+
it is before starting a new build.
12258

123-
.. cmdoption:: --opt LEVEL
59+
.. option:: --opt LEVEL
12460

125-
When used with the :option:`build` action this specifies the level of
126-
optimisation performed when freezing Python source files:
61+
``LEVEL`` is the level of optimisation performed when freezing Python
62+
source files:
12763

12864
0 - no optimisation is done
12965

@@ -133,133 +69,135 @@ The full set of command line options is:
13369

13470
The default is ``2``.
13571

136-
.. cmdoption:: --output OUTPUT
72+
.. option:: --python-library LIB
13773

138-
When used with the :option:`build` action this specifies the name of the
139-
build directory where all the application source code will be placed. By
140-
default the directory defined in the project file is used.
74+
``LIB`` is the name of the target Python interpreter library. It overrides
75+
any value specified in the project file.
14176

142-
When used with the :option:`configure` action this specifies the name of
143-
the configuration file that is created. By default the file is called
144-
``package-target.cfg`` (where *package* is the name of the package and
145-
*target* is the name of the target platform) and placed in the current
146-
directory.
77+
.. option:: --resources NUMBER
14778

148-
.. cmdoption:: --package PACKAGE
79+
``NUMBER`` is the number of Qt ``.qrc`` resource files that are generated.
80+
On Windows, MSVC cannot cope with very large resource files and complains
81+
of a lack of heap space. If you run into this problem then try increasing
82+
the the number of resource files generated.
14983

150-
This is required by the :option:`configure` and :option:`install` actions
151-
to specify the package.
84+
.. option:: --source-dir DIR
15285

153-
.. cmdoption:: --project FILE
86+
``DIR`` is the name of the directory containing the Python source code. It
87+
overrides any value specified in the project file.
15488

155-
This is required by the :option:`build` action to specify the project file.
89+
.. option:: --standard-library-dir DIR
15690

157-
.. cmdoption:: --python-library
91+
``DIR`` is the name of the directory containing the target Python
92+
interpreter's standard library. It overrides any value specified in the
93+
project file.
15894

159-
.. versionadded:: 1.2
95+
.. option:: --sysroot DIR
16096

161-
When used with the :option:`build` action this specifies the name of the
162-
target Python interpreter library. It overrides any value specified in the
163-
project file.
97+
``DIR`` is the name of the system image root directory. The
98+
:envvar:`SYSROOT` environment variable is set to ``DIR`` during the build.
16499

165-
.. cmdoption:: --resources NUMBER
100+
.. option:: --target TARGET
166101

167-
When used with the :option:`build` action this specifies the number of Qt
168-
``.qrc`` resource files that are generated. On Windows, MSVC cannot cope
169-
with very large resource files and complains of a lack of heap space. If
170-
you run into this problem then try increasing the the number of resource
171-
files generated.
102+
``TARGET`` is the target architecture. By default the host architecture is
103+
used. The full architecture consists of the platform (``android``,
104+
``ios``, ``linux``, ``macos`` or ``win``) and the target word size
105+
separated by a ``-``. For example ``android-32``, ``macos-64``. Note that
106+
not all platform/word size combinations are supported.
172107

173-
.. cmdoption:: --source-dir
108+
.. option:: --quiet
174109

175-
.. versionadded:: 1.2
110+
This specifies that progress messages should be disabled.
176111

177-
When used with the :option:`build` action this specifies the name of the
178-
directory containing the Python source code. It overrides any value
179-
specified in the project file.
112+
.. option:: --verbose
180113

181-
.. cmdoption:: --standard-library-dir
114+
This specifies that additional progress messages should be enabled.
182115

183-
.. versionadded:: 1.2
116+
.. option:: -V, --version
184117

185-
When used with the :option:`build` action this specifies the name of the
186-
directory containing the target Python interpreter's standard library. It
187-
overrides any value specified in the project file.
118+
This specifies that the version number should be displayed on ``stdout``.
119+
The program will then terminate.
120+
121+
.. option:: project
188122

189-
.. cmdoption:: --sysroot
123+
``project`` is the name of the project file created with
124+
:program:`pyqtdeploy`.
190125

191-
.. versionadded:: 1.2
192126

193-
When used with the :option:`install` action this specifies the name of the
194-
system image root directory as recommended in
195-
:ref:`ref-directory-structure`.
127+
.. program:: pyqtdeploy-sysroot
196128

197-
.. cmdoption:: --system-python VERSION
129+
:program:`pyqtdeploy-sysroot`
130+
-----------------------------
198131

199-
.. versionadded:: 1.2
132+
:program:`pyqtdeploy-sysroot` is used to create a target-specific system root
133+
directory (*sysroot*) containing the target Python installation and any
134+
external packages and extension modules used by the application.
135+
136+
The full set of command line options is:
200137

201-
When used with the :option:`install` action to install the ``python``
202-
package this specifies the version number of Python to use. Only the major
203-
and minor version numbers need be specified (e.g. ``3.5``).
138+
.. option:: -h, --help
204139

205-
.. cmdoption:: --target TARGET
140+
This will display a summary of the command line options.
206141

207-
This is used with the :option:`configure` and :option:`install` actions to
208-
specify the target platform. By default the host platform is used. The
209-
full target consists of the base target and an optional target variant
210-
(usually related to the target's word size). The supported base targets
211-
are ``linux``, ``win``, ``osx``, ``ios`` and ``android``. The
212-
:option:`show-targets` action will list the supported targets including the
213-
target variants.
142+
.. option:: --no-clean
214143

215-
.. cmdoption:: --timeout SECONDS
144+
A temporary build directory (called ``build`` in the sysroot) is created in
145+
order to build the required packages. Normally this is removed
146+
automatically after all packages have been built. Specifying this option
147+
leaves the build directory as it is to make debugging package plugins
148+
easier.
216149

217-
.. versionadded:: 1.3.2
150+
.. option:: --options
218151

219-
When used with the :option:`build` action this specifies the number of
220-
seconds to wait for build processes to run before timing out. The default
221-
value is 30.
152+
This causes the configurable options of each package specified in the JSON
153+
file to be displayed on ``stdout``. The program will then terminate.
222154

223-
.. cmdoption:: --quiet
155+
.. option:: --package PACKAGE
224156

225-
This is used with the :option:`build` action to specify that progress
226-
messages should be disabled.
157+
``PACKAGE`` is the name of the package (specified in the JSON file) that
158+
will be built. It may be used more than once to build multiple packages.
159+
If the option is not specified then all packages specified in the JSON file
160+
will be built.
227161

228-
.. cmdoption:: --verbose
162+
.. option:: --plugin-dir DIR
229163

230-
This is used with the :option:`build` action to specify that additional
231-
progress messages should be enabled.
164+
``DIR`` is added to the list of directories that are searched for package
165+
plugins. It may be used more than once to search multiple directories.
166+
All directories specified in this way will be searched before those
167+
directories (internal to :program:`pyqtdeploy-sysroot`) searched by
168+
default.
232169

170+
.. option:: --source-dir DIR
233171

234-
Examples
235-
--------
172+
``DIR`` is the name of the directory containing the source archives used to
173+
build the packages specified in the JSON file.
236174

237-
::
175+
.. option:: --sysroot DIR
238176

239-
pyqtdeploycli --output /tmp/build --project myproject.pdy --quiet build
177+
``DIR`` is the name of the system root directory. The default value is
178+
``sysroot-`` followed by a target-specific suffix. Unless the
179+
:option:`--package` option is specified any existing sysroot will first be
180+
removed and re-created.
240181

241-
The code for the application described by the ``myproject.pdy`` project file
242-
will be created in the ``/tmp/build`` directory. All progress messages will be
243-
disabled.
182+
.. option:: --target TARGET
244183

245-
::
184+
``TARGET`` is the target architecture. By default the host architecture is
185+
used.
246186

247-
pyqtdeploycli --package pyqt5 configure
187+
.. option:: --quiet
248188

249-
If this command was run on a Linux system then a configuration file for
250-
building PyQt5 for Linux, called ``pyqt5-linux.cfg``, would be created in the
251-
current directory.
189+
This specifies that progress messages should be disabled.
252190

253-
::
191+
.. option:: --verbose
254192

255-
pyqtdeploycli --package pyqt4 --target android configure
193+
This specifies that additional progress messages should be enabled.
256194

257-
A configuration file for building PyQt4 for Android, called
258-
``pyqt4-android.cfg`` will be created in the current directory.
195+
.. option:: -V, --version
259196

260-
::
197+
This specifies that the version number should be displayed on ``stdout``.
198+
The program will then terminate.
261199

262-
pyqtdeploycli --output /tmp/pyqt.config --package pyqt5 --target ios configure
200+
.. option:: json
263201

264-
A configuration file for building PyQt5 for iOS, called ``pyqt.config`` will be
265-
created in the ``/tmp`` directory.
202+
``json`` is the name of a JSON text file that specifies each package to be
203+
included in the sysroot and how they are to be configured.

doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16+
import datetime
1617
import sys
1718
import os
1819

@@ -45,7 +46,8 @@
4546

4647
# General information about the project.
4748
project = 'pyqtdeploy'
48-
copyright = '2017, Riverbank Computing Limited'
49+
copyright = '{0}, Riverbank Computing Limited'.format(
50+
datetime.date.today().year)
4951

5052
# The version info for the project you're documenting, acts as replacement for
5153
# |version| and |release|, also used in various other places throughout the

0 commit comments

Comments
 (0)