Skip to content

Commit 4ce2db0

Browse files
committed
add instructions to Contributing.md
1 parent 36fff01 commit 4ce2db0

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Contributing.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,22 @@ You can run these checks yourself with `nox`. Use `nox -l` to list the full set
109109
`nox -s clippy-all`
110110

111111
#### Tests
112-
`nox -s test` or `cargo test` for Rust tests only, `nox -f pytests/noxfile.py -s test` for Python tests only
112+
`nox -s test` or `cargo test` or `cargo nextest` for Rust tests only, `nox -f pytests/noxfile.py -s test` for
113+
Python tests only.
114+
115+
Configuring the python interpreter version (`Py_*` cfg options) when running `cargo test` is the same as for regular packages which is explained in [the docs](https://pyo3.rs/v0.22.5/building-and-distribution).
116+
The easiest way to configure the python version is to install with the system package manager or
117+
[pyenv](https://github.com/pyenv/pyenv) then set `PYO3_PYTHON`.
118+
[uv python install](https://docs.astral.sh/uv/concepts/python-versions/) cannot currently be used as it sets some
119+
[incorrect sysconfig values](https://github.com/astral-sh/uv/issues/8429).
120+
121+
`Py_LIMITED_API` can be controlled with the `abi3` feature of the `pyo3` crate:
122+
123+
```
124+
PYO3_PYTHON=/path/to/python cargo nextest run --package pyo3 --features abi3 ...
125+
```
126+
127+
use the `PYO3_PRINT_CONFIG=1` to check the identified configuration.
113128

114129
#### Check all conditional compilation
115130
`nox -s check-feature-powerset`
@@ -183,7 +198,10 @@ PyO3 supports all officially supported Python versions, as well as the latest Py
183198

184199
PyO3 aims to make use of up-to-date Rust language features to keep the implementation as efficient as possible.
185200

186-
The minimum Rust version supported will be decided when the release which bumps Python and Rust versions is made. At the time, the minimum Rust version will be set no higher than the lowest Rust version shipped in the current Debian, RHEL and Alpine Linux distributions.
201+
The minimum Rust version supported will be decided when the release which bumps Python and Rust versions is made. At the time, the minimum Rust version will be set no higher than the lowest Rust version shipped in the current
202+
[Debian](https://packages.debian.org/search?keywords=rustc),
203+
[RHEL](https://docs.redhat.com/en/documentation/red_hat_developer_tools/1) and
204+
[Alpine Linux](https://pkgs.alpinelinux.org/package/edge/main/x86/rust) distributions.
187205

188206
CI tests both the most recent stable Rust version and the minimum supported Rust version. Because of Rust's stability guarantees this is sufficient to confirm support for all Rust versions in between.
189207

0 commit comments

Comments
 (0)