Cargo Features

[dependencies]
python3-sys = { version = "0.7.1", default-features = false, features = ["extension-module", "link-mode-default", "link-mode-unresolved-static", "python-3", "python-3-4", "python-3-8", "python-3-11", "pep-384"] }
default = python-3

This is examined by ./build.rs to determine which python version to try to bind to.

extension-module

Use this feature when building an extension module.
It tells the linker to keep the python symbols unresolved,
so that the module can also be used with statically linked python interpreters.

This feature implies default linking behavior.

If not an extension module or on Windows, the crate will link against pythonXY where XY is derived from the discovered Python version. The link type will be static, shared, or framework depending on the discovered Python.

The path to pythonXY from the discovered Python install may also be added to the linker search path.

This link mode is used by default unless an alternate link mode feature is used.

This feature forces Python symbols to be unresolved by emitting a rustc-link-lib=static-nobundle=pythonXY directive on Windows (which is the only platform where it makes sense).

This mode is useful for scenarios where you want another crate to emit the linker directives that define the location of a static Python library.

This mode is typically not needed, as Python distributions on Windows rarely use a static Python library.

python-3 default

Bind to any python 3.x.

python-3-4

Or, bind to a particular minor version.

python-3-5 python-3-6 python-3-7 python-3-8
python-3-9 python-3-10 python-3-11
pep-384

Restrict to PEP-384 stable ABI