Skip to content

Commit

Permalink
add instructions to Contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mbway committed Nov 3, 2024
1 parent 5499d10 commit 401af6c
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,22 @@ You can run these checks yourself with `nox`. Use `nox -l` to list the full set
`nox -s clippy-all`

#### Tests
`nox -s test` or `cargo test` for Rust tests only, `nox -f pytests/noxfile.py -s test` for Python tests only
`nox -s test` or `cargo test` or `cargo nextest` for Rust tests only, `nox -f pytests/noxfile.py -s test` for
Python tests only.

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).
The easiest way to configure the python version is to install with the system package manager or
[pyenv](https://github.com/pyenv/pyenv) then set `PYO3_PYTHON`.
[uv python install](https://docs.astral.sh/uv/concepts/python-versions/) cannot currently be used as it sets some
[incorrect sysconfig values](https://github.com/astral-sh/uv/issues/8429).

`Py_LIMITED_API` can be controlled with the `abi3` feature of the `pyo3` crate:

```
PYO3_PYTHON=/path/to/python cargo nextest run --package pyo3 --features abi3 ...
```

use the `PYO3_PRINT_CONFIG=1` to check the identified configuration.

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

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

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.
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](https://packages.debian.org/search?keywords=rustc),
[RHEL](https://docs.redhat.com/en/documentation/red_hat_developer_tools/1) and
[Alpine Linux](https://pkgs.alpinelinux.org/package/edge/main/x86/rust) distributions.

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.

Expand Down

0 comments on commit 401af6c

Please sign in to comment.