Skip to content

Commit

Permalink
Mention export-config feature in the guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Anderson committed Jan 25, 2022
1 parent 8c4b0b4 commit 711bbc0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions guide/src/building_and_distribution.md
Expand Up @@ -50,6 +50,8 @@ If you save the above output config from `PYO3_PRINT_CONFIG` to a file, it is po

If your build environment is unusual enough that PyO3's regular configuration detection doesn't work, using a config file like this will give you the flexibility to make PyO3 work for you. To see the full set of options supported, see the documentation for the [`InterpreterConfig` struct](https://docs.rs/pyo3-build-config/{{#PYO3_DOCS_VERSION}}/pyo3_build_config/struct.InterpreterConfig.html).

The `export-config` feature of the `pyo3-build-config` crate also allows these values to be exported for use in other crates, and `pyo3-build-config` offers a funciton for reading them in and constructing an `InterpreterConfig`.

## Building Python extension modules

Python extension modules need to be compiled differently depending on the OS (and architecture) that they are being compiled for. As well as multiple OSes (and architectures), there are also many different Python versions which are actively supported. Packages uploaded to [PyPI](https://pypi.org/) usually want to upload prebuilt "wheels" covering many OS/arch/version combinations so that users on all these different platforms don't have to compile the package themselves. Package vendors can opt-in to the "abi3" limited Python API which allows their wheels to be used on multiple Python versions, reducing the number of wheels they need to compile, but restricts the functionality they can use.
Expand Down
8 changes: 8 additions & 0 deletions guide/src/features.md
Expand Up @@ -77,6 +77,14 @@ The `resolve-config` feature of the `pyo3-build-config` crate controls whether t
build script automatically resolves a Python interpreter / build configuration. This feature is primarily useful when building PyO3
itself. By default this feature is not enabled, meaning you can freely use `pyo3-build-config` as a standalone library to read or write PyO3 build configuration files or resolve metadata about a Python interpreter.

### `export-config`

The `export-config` feature of the `pyo3-build-config` crate controls whether
that crate exports the build configuration for use in other crates. This
feature may be useful if building an additional dependency that requires access
to the Python interpreter used to build PyO3 itself. This feature should be
used with caution as it can impact build portability.

## Optional Dependencies

These features enable conversions between Python types and types from other Rust crates, enabling easy access to the rest of the Rust ecosystem.
Expand Down

0 comments on commit 711bbc0

Please sign in to comment.