Cargo Features

[dependencies]
libcst = { version = "1.3.1", default-features = false, features = ["py", "trace"] }
default = py

This is a bit of a hack, since cargo test doesn't work with extension-module. To run tests, use cargo test --no-default-features.

Once https://github.com/PyO3/pyo3/pull/1123 lands, it may be better to use -Zextra-link-arg for this instead.

py default = pyo3

Enables extension-module of pyo3 ^0.20

pyo3:

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.

Affects libcst::py, traits::py

trace

Enables trace of peg

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

pyo3 py

Enables pyo3 ^0.20