Reference¶
This page lists every configuration option, with its type and default. Options fall into two kinds:
Common options may be set at the package, module, or class level and inherit downwards: a value set on the package applies to every module and class in it, unless a lower level overrides it. For example,
auto_includesset at the package level applies to the whole package.Level-specific options are only meaningful at one level. For example:
modulesat the package level.importsat the module level.name_overrideat the class level.
Each table below covers one level; a – in the Default column marks a
required option.
Common options¶
Settable at the package, module, or class level; they inherit downwards.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
list[str] |
|
Skip any method/constructor with an argument type matching one of these. |
|
bool |
|
Auto-resolve headers for project types used in wrapped signatures. See Includes. |
|
list[str] |
|
Skip any constructor with an argument type matching one of these. |
|
list[list[str]] |
|
Skip a constructor whose full argument-type list matches an entry. |
|
str |
|
Path to a Python template that injects extra binding code. See Custom generators. |
|
dict |
|
Drop discovered instantiations by template-argument value. See Templates. |
|
bool |
|
Auto-discover explicit instantiations from the source. See Templates. |
|
bool |
|
Exclude the whole class from wrapping. |
|
list[str] |
|
Method names to skip. |
|
str |
|
Default pybind11 |
|
list[str] |
|
Lines emitted before a class’s registration block. |
|
str |
|
Text emitted at the top of each wrapper file (e.g. a licence header). |
|
str |
|
Default pybind11 |
|
list[str] |
|
Skip any method with a return type matching one of these. |
|
str |
|
Holder type declared for wrapped classes, e.g. |
|
list[str] |
|
Extra headers to add to the wrapper’s |
|
list[str] |
|
Lines emitted after a class’s |
|
list |
|
Explicit template instantiations to wrap. See Templates. |
CPPWG_SOURCEROOT in a path value (e.g. in custom_generator) is replaced with
the source root directory.
Package options¶
Set at the top level of the file.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
|
If true, every wrapper includes a single shared header collection instead of its own headers. Turn off so each wrapper includes only what it needs. |
|
list |
|
C++ exception classes to translate into Python. See Exceptions. |
|
bool |
|
If true, omit C++ default argument values from the generated bindings. |
|
bool |
|
If true, skip redundant |
|
list |
– |
The modules to build. See Module options. |
|
str |
|
Package name; prepended to every module’s extension name ( |
|
list[str] |
|
Glob patterns for the source files cppwg scans (used for template-instantiation discovery). |
|
list[str] |
|
Glob patterns for the header files cppwg scans. |
|
list |
|
Type-caster headers to auto-include by type. See Type casters. |
All common options may also be set here.
Module options¶
Each entry under modules:.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
list |
|
Classes to wrap, or the string |
|
list[str] |
|
Base-class names registered by an imported package, so cppwg will emit them as bases. See Cross-module inheritance. |
|
list |
|
Free functions to wrap, or |
|
list[str] |
|
Python modules to import at the start of this module, so their types are registered first. Required for cross-module inheritance. See Cross-module inheritance. |
|
str |
|
Module name; the extension is |
|
list[str] |
|
Directories (relative to the source root) whose classes this module wraps. |
All common options may also be set here.
Class options¶
Each entry under a module’s classes:.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
str |
– |
The C++ class name (required). |
|
str |
|
Python name for the class, if different from the C++ name. |
|
str |
|
Header to attribute the class to, when the class name does not match its file name. |
All common options may also be set here.