Skip to content

Commit ccce96d

Browse files
committed
add instructions to Contributing.md
1 parent 5499d10 commit ccce96d

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Contributing.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,23 @@ 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
116+
packages which is explained in [the docs](https://pyo3.rs/v0.22.5/building-and-distribution).
117+
The easiest way to configure the python version is to install with the system package manager or
118+
[pyenv](https://github.com/pyenv/pyenv) then set `PYO3_PYTHON`.
119+
[uv python install](https://docs.astral.sh/uv/concepts/python-versions/) cannot currently be used as it sets some
120+
[incorrect sysconfig values](https://github.com/astral-sh/uv/issues/8429).
121+
122+
`Py_LIMITED_API` can be controlled with the `abi3` feature of the `pyo3` crate:
123+
124+
```
125+
PYO3_PYTHON=/path/to/python cargo nextest run --package pyo3 --features abi3 ...
126+
```
127+
128+
use the `PYO3_PRINT_CONFIG=1` to check the identified configuration.
113129

114130
#### Check all conditional compilation
115131
`nox -s check-feature-powerset`
@@ -183,7 +199,11 @@ PyO3 supports all officially supported Python versions, as well as the latest Py
183199

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

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

188208
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.
189209

0 commit comments

Comments
 (0)