File: command_line_tools.rst

package info (click to toggle)
sip6 6.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,888 kB
  • sloc: ansic: 192,450; python: 20,951; makefile: 25; cpp: 20
file content (636 lines) | stat: -rw-r--r-- 19,965 bytes parent folder | download
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
Command Line Tools
==================

The tools can also be invoked using the ``-m`` command line option of the
Python interpreter.  For example, the following two command lines are
equivalent::

    sip-build -h
    python -m sipbuild.tools.build -h

Note that, for the build tools, the command line options described in this
section are the standard options.  Any of these options could be removed, or
new options added, by build system extensions including project-specific
:file:`project.py` files.


:program:`sip-build`
--------------------

:program:`sip-build` builds a project but does not install it.  This is useful
when developing a set of bindings.

The syntax of the :program:`sip-build` command line is::

    sip-build [options]

The full set of command line options is:

.. program:: sip-build

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --deprecations-are-errors

    The use of any deprecated feature is handled as an error rather than a
    warning.

.. option:: --quiet

    All progress messages are disabled.

.. option:: --verbose

    Verbose progress messages are enabled.

.. option:: --abi-version M[.N]

    The version number of the ABI of the :mod:`sip` module to target is
    ``M.N``.  By default the latest major version is used.  If the minor
    version is not specified then the latest minor version of the major version
    is used.

.. option:: --api-dir DIR

    A QScintilla :file:`.api` file is created in ``DIR``.

.. option:: --build-dir DIR

    ``DIR`` is created as a build directory in which all generated files will
    be created.  The build directory is not removed after the build has been
    completed.  The default value is ``build``.

.. option:: --concatenate N

    The generated code is split into ``N`` files.  By default one file is
    generated for each C structure or C++ class.  Specifying a low value of
    ``N`` can significantly speed up the build of large projects.

.. option:: --disable NAME

    The ``NAME`` bindings are disabled and will not be built.  This option may
    be specified multiple times.  It is only available if the project contains
    multiple sets of bindings.

.. option:: --disabled-feature TAG

    The ``TAG`` feature tag is disabled.  This option may be specified multiple
    times.

.. option:: --enable NAME

    The ``NAME`` bindings are enabled and will be built.  Any associated
    configuration tests that would normally be run to determine if the bindings
    should be built are suppressed.  This option may be specified multiple
    times.  It is only available if the project contains multiple sets of
    bindings.

.. option:: --debug

    A build with debugging symbols is performed.

.. option:: --no-compile

    The compilation of the generated code is disabled.

.. option:: --no-docstrings

    The generation of docstrings that describe the signature of all functions,
    methods and constructors is disabled.

.. option:: --no-version-info

    No reference the SIP version number is included in any generated code.

.. option:: --pep484-pyi

    The generation of Python type hints stub files is enabled.  These files
    contain a description of a module's API that is compliant with `PEP 484
    <https://www.python.org/dev/peps/pep-0484/>`__.

.. option:: --protected-is-public

    SIP can generate code to provide access to protected C++ functions from
    Python.  On non-Windows platforms this code can be avoided if the
    ``protected`` keyword is redefined as ``public`` during compilation.  This
    can result in a significant reduction in the size of a generated Python
    module.  This option enables the redefinition of ``protected`` and is the
    default on all platforms except Windows.

.. option:: --no-protected-is-public

    This option disables the redefinition of ``protected`` to access protected
    C++ functions from Python and is the default on Windows.

.. option:: --scripts-dir DIR

    Any project scripts will eventually be installed in ``DIR``.  If ``DIR`` is
    relative then it is taken as relative to the target directory.  By default
    the directory containing the Python interpreter is used.

.. option:: --target-dir DIR

    The project will eventually be installed in ``DIR``.  By default it is the
    :file:`site-packages` directory of the Python installation.

.. option:: --tracing

    Debugging statements that trace the execution of the bindings are
    automatically generated.  By default the statements are not generated.


:program:`sip-distinfo`
-----------------------

:program:`sip-distinfo` creates and populates a :file:`.dist-info` directory of
an installation or a wheel.  It is provided for build systems that extend the
SIP build system and need to create the :file:`.dist-info` directory from an
external tool such as :program:`make`.

The syntax of the :program:`sip-distinfo` command line is::

    sip-distinfo [options] directory

``directory`` is the full path name of the directory to create.

The full set of command line options is:

.. program:: sip-distinfo

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --console-script ENTRY-POINT

    The console entry point ``ENTRY-POINT`` is added to the wheel.  It is
    ignored if the :option:`--wheel-tag` option is not specified.  This option
    may be specified multiple times.

.. option:: --generator NAME

    If the :option:`--wheel-tag` option is specified then ``NAME`` is written
    as part of the ``Generator`` in the :file:`WHEEL` file in the
    :file:`.dist-info` directory.  Otherwise ``NAME`` is written to the
    :file:`INSTALLER` file.  By default ``sipbuild`` is written.

.. option:: --generator-version VERSION

    ``VERSION`` is written as part of the ``Generator`` in the :file:`WHEEL`
    file in the :file:`.dist-info` directory.  By default the SIP version
    number is written.

.. option:: --gui-script ENTRY-POINT

    The GUI entry point ``ENTRY-POINT`` is added to the wheel.  It is
    ignored if the :option:`--wheel-tag` option is not specified.  This option
    may be specified multiple times.

.. option:: --inventory FILE

    ``FILE`` contains a list of the relative names of the files, one per line, 
    that comprise the installation or wheel contents.  This option must be
    specified.

.. option:: --metadata NAME[=VALUE]

    ``VALUE`` is used instead of any value specified for ``NAME`` in the
    ``[tool.sip.metadata]`` section of the :file:`pyproject.toml` file.

.. option:: --prefix DIR

    This option is provided as an aid to Linux package builders.  ``DIR`` is
    used to pass the commonly used values of ``DESTDIR`` or ``INSTALL_ROOT``.
    If specified it should have a trailing native path separator.

.. option:: --project-root DIR

    The name of the directory containing the project's :file:`pyproject.toml`
    file is ``DIR``.  This option must be specified.

.. option:: --requires-dist EXPR

    ``EXPR`` is added to the list of prerequisites written to the
    :file:`METADATA` file in the :file:`.dist-info` directory.  It is normally
    used to specify a particular version of a package project's :mod:`sip`
    module.  This option may be specified multiple times.

.. option:: --sbom FILE

    .. versionadded:: 6.13

    ``FILE`` is copied to the :file:`sboms` subdirectory of the
    :file:`.dist-info` directory as defined in PEP 770.  ``FILE`` may be a
    glob-style pattern.  This option may be specified multiple times.

.. option:: --wheel-tag TAG

    ``TAG`` is written as the ``Tag`` in the :file:`WHEEL` file in the
    :file:`.dist-info` directory.


:program:`sip-install`
----------------------

:program:`sip-install` builds and installs a project.

The syntax of the :program:`sip-install` command line is::

    sip-install [options]

The full set of command line options is:

.. program:: sip-install

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --deprecations-are-errors

    The use of any deprecated feature is handled as an error rather than a
    warning.

.. option:: --quiet

    All progress messages are disabled.

.. option:: --verbose

    Verbose progress messages are enabled.

.. option:: --abi-version M[.N]

    The version number of the ABI of the :mod:`sip` module to target is
    ``M.N``.  By default the latest major version is used.  If the minor
    version is not specified then the latest minor version of the major version
    is used.

.. option:: --api-dir DIR

    A QScintilla :file:`.api` file is created in ``DIR``.

.. option:: --build-dir DIR

    ``DIR`` is created as a build directory in which all generated files will
    be created.  This build directory is not removed after the build has been
    completed.  By default a temporary build directory is created which is
    removed after the build has been completed.

.. option:: --concatenate N

    The generated code is split into ``N`` files.  By default one file is
    generated for each C structure or C++ class.  Specifying a low value of
    ``N`` can significantly speed up the build of large projects.

.. option:: --disable NAME

    The ``NAME`` bindings are disabled and will not be built.  This option may
    be specified multiple times.  It is only available if the project contains
    multiple sets of bindings.

.. option:: --disabled-feature TAG

    The ``TAG`` feature tag is disabled.  This option may be specified multiple
    times.

.. option:: --enable NAME

    The ``NAME`` bindings are enabled and will be built.  Any associated
    configuration tests that would normally be run to determine if the bindings
    should be built are suppressed.  This option may be specified multiple
    times.  It is only available if the project contains multiple sets of
    bindings.

.. option:: --debug

    A build with debugging symbols is performed.

.. option:: --no-docstrings

    The generation of docstrings that describe the signature of all functions,
    methods and constructors is disabled.

.. option:: --no-distinfo

    The creation of the :file:`.dist-info` directory is disabled.

.. option:: --pep484-pyi

    The generation of Python type hints stub files is enabled.  These files
    contain a description of a module's API that is compliant with `PEP 484
    <https://www.python.org/dev/peps/pep-0484/>`__.

.. option:: --protected-is-public

    SIP can generate code to provide access to protected C++ functions from
    Python.  On non-Windows platforms this code can be avoided if the
    ``protected`` keyword is redefined as ``public`` during compilation.  This
    can result in a significant reduction in the size of a generated Python
    module.  This option enables the redefinition of ``protected`` and is the
    default on all platforms except Windows.

.. option:: --no-protected-is-public

    This option disables the redefinition of ``protected`` to access protected
    C++ functions from Python and is the default on Windows.

.. option:: --scripts-dir DIR

    Any project scripts will be installed in ``DIR``.  If ``DIR`` is relative
    then it is taken as relative to the target directory.  By default the
    directory containing the Python interpreter is used.

.. option:: --target-dir DIR

    The project will be installed in ``DIR``.  By default it is the
    :file:`site-packages` directory of the Python installation.

.. option:: --tracing

    Debugging statements that trace the execution of the bindings are
    automatically generated.  By default the statements are not generated.


:program:`sip-module`
---------------------

:program:`sip-module` builds one of more of the elements of the :mod:`sip`
module for a set of package projects.

The syntax of the :program:`sip-module` command line is::

    sip-module [options] name

``name`` is the fully qualified name of the :mod:`sip` module (i.e. including
the package name).

The full set of command line options is:

.. program:: sip-module

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --abi-version MAJOR[.MINOR]

    The major version number of the ABI implemented by the :mod:`sip` module is
    ``MAJOR``.  If a minor version number is also specified it is interpreted
    as a minimum minor version rather than the exact minor version to be used.
    By default the very latest version is used.

.. option:: --option NAME

    The :mod:`sip` module will be built using the ``NAME`` configuration
    option.  See the :directive:`%SipModuleConfiguration` directive for a list
    of possible options and their meanings.  This option may be specified
    multiple times.

.. option:: --project NAME

    The name of the project as it would appear on PyPI is ``NAME``.  By default
    the name is derived from the fully qualified name of the :mod:`sip`
    module.

.. option:: --sdist

    Create an sdist which can then be installed by :program:`pip` or uploaded
    to PyPI.

    :program:`pip` can also be used to create a wheel from the sdist.  However,
    for Linux wheels, :program:`auditwheel` must be run for the wheel before it
    can be uploaded to PyPI.

.. option:: --setup-cfg FILE

    ``FILE`` is copied to the sdist as :file:`setup.cfg` instead of the default
    version.  This allows the sdist to be customised.  A number of macros may
    be specified in the :file:`setup.cfg` file:

        ``@SIP_MODULE_FQ_NAME@`` is replaced by the fully qualified name
        of the :mod:`sip` module.

        ``@SIP_MODULE_PACKAGE_NAME@`` is replaced by the module's project
        top-level package name.

        ``@SIP_MODULE_PROJECT_NAME@`` is replaced by the module's project name
        as it would appear on PyPI.

        ``@SIP_MODULE_VERSION@`` is replaced by the version number of the
        module.

.. option:: --sip-h

    Create a :file:`sip.h` header file that defines the C ABI implemented by
    the :mod:`sip` module.

.. option:: --sip-rst

    Create a :file:`sip.rst` file that documents the Python API implemented by
    the :mod:`sip` module.

.. option:: --target-dir DIR

    Each of the module's elements will be created in ``DIR``.


:program:`sip-sdist`
--------------------

:program:`sip-sdist` creates an sdist (a source distribution) than be uploaded
to PyPI.

The syntax of the :program:`sip-sdist` command line is::

    sip-sdist [options]

.. versionchanged:: 6.9.1

    The name of the sdist file now conforms to PEP 625 (i.e. it is all lower
    case).

The full set of command line options is:

.. program:: sip-sdist

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --abi-version M[.N]

    The version number of the ABI of the :mod:`sip` module to target is
    ``M.N``.  By default the latest major version is used.  If the minor
    version is not specified then the latest minor version of the major version
    is used.

.. option:: --deprecations-are-errors

    The use of any deprecated feature is handled as an error rather than a
    warning.

.. option:: --name NAME

    ``NAME`` is used instead of the PyPI project name in the
    :file:`pyproject.toml` file in the name of the sdist file.


:program:`sip-wheel`
--------------------

:program:`sip-wheel` creates a wheel (a binary distribution) than be uploaded
to PyPI.

The syntax of the :program:`sip-wheel` command line is::

    sip-wheel [options]

The full set of command line options is:

.. program:: sip-wheel

.. option:: -h, --help

    Display a help message.

.. option:: -V, --version

    Display the SIP version number.

.. option:: --deprecations-are-errors

    The use of any deprecated feature is handled as an error rather than a
    warning.

.. option:: --quiet

    All progress messages are disabled.

.. option:: --verbose

    Verbose progress messages are enabled.

.. option:: --abi-version M[.N]

    The version number of the ABI of the :mod:`sip` module to target is
    ``M.N``.  By default the latest major version is used.  If the minor
    version is not specified then the latest minor version of the major version
    is used.

.. option:: --api-dir DIR

    A QScintilla :file:`.api` file is created in ``DIR``.  This must be a name
    relative to the directory where the wheel will be installed.

.. option:: --build-dir DIR

    ``DIR`` is created as a build directory in which all generated files will
    be created.  This build directory is not removed after the build has been
    completed.  By default a temporary build directory is created which is
    removed after the build has been completed.

.. option:: --build-tag TAG

    ``TAG`` is the build tag to be used in the name of the wheel.  By default
    the name of the wheel does not include a build tag.

.. option:: --concatenate N

    The generated code is split into ``N`` files.  By default one file is
    generated for each C structure or C++ class.  Specifying a low value of
    ``N`` can significantly speed up the build of large projects.

.. option:: --disable NAME

    The ``NAME`` bindings are disabled and will not be built.  This option may
    be specified multiple times.  It is only available if the project contains
    multiple sets of bindings.

.. option:: --disabled-feature TAG

    The ``TAG`` feature tag is disabled.  This option may be specified multiple
    times.

.. option:: --enable NAME

    The ``NAME`` bindings are enabled and will be built.  Any associated
    configuration tests that would normally be run to determine if the bindings
    should be built are suppressed.  This option may be specified multiple
    times.  It is only available if the project contains multiple sets of
    bindings.

.. option:: --no-manylinux

    Support for ``manylinux`` in the platform tag of a name of a wheel is
    disabled.  It should only be used if support for older versions of
    :program:`pip` is required.

.. option:: --minimum-glibc-version M.N

    ``M.N`` is the minimum GLIBC version required by the project specified as
    the major and minor version numbers.  This is used to determine the correct
    platform tag to use for Linux wheels.  The default version of GLIBC is v2.5
    which corresponds to ``manylinux1``.  It is ignored if the
    ``--no-manylinux`` option is specified.

.. option:: --name NAME

    ``NAME`` is used instead of the PyPI project name in the
    :file:`pyproject.toml` file in the name of the wheel file.

.. option:: --debug

    A build with debugging symbols is performed.

.. option:: --no-docstrings

    The generation of docstrings that describe the signature of all functions,
    methods and constructors is disabled.

.. option:: --pep484-pyi

    The generation of Python type hints stub files is enabled.  These files
    contain a description of a module's API that is compliant with `PEP 484
    <https://www.python.org/dev/peps/pep-0484/>`__.

.. option:: --protected-is-public

    SIP can generate code to provide access to protected C++ functions from
    Python.  On non-Windows platforms this code can be avoided if the
    ``protected`` keyword is redefined as ``public`` during compilation.  This
    can result in a significant reduction in the size of a generated Python
    module.  This option enables the redefinition of ``protected`` and is the
    default on all platforms except Windows.

.. option:: --no-protected-is-public

    This option disables the redefinition of ``protected`` to access protected
    C++ functions from Python and is the default on Windows.

.. option:: --tracing

    Debugging statements that trace the execution of the bindings are
    automatically generated.  By default the statements are not generated.