PyO3 / PyO3/pyo3

Doc statement about minimum abi3 version is wrong

Open
#4,966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

https://pyo3.rs/v0.14.5/building_and_distribution#minimum-python-version-for-abi3

Note: If you set more that one of these api version feature flags the highest version always wins. For example, with both abi3-py36 and abi3-py38 set, PyO3 would build a wheel which supports Python 3.8 and up.

The docs state that the highest abi3 version will win. But pyo3-build-config selects the lowest one.

https://github.com/PyO3/pyo3/blob/059e249057e895cfa36504890dfa79943f0b49c5/pyo3-build-config/src/impl_.rs#L854-L858

Secondly the lower abi3 feature flags enable the higher ones as well so setting a higher flag will be essentially a no-op if their is a lower one present.

https://github.com/PyO3/pyo3/blob/059e249057e895cfa36504890dfa79943f0b49c5/Cargo.toml#L97-L103

I would like to use the (wrongly stated) feature to dynamically build higher abi3 wheels with maturin build --features pyo3/abi3_py312 but leave the default feature set compatible with abi3_py39. Is it possible to make this work or should we update the docs that this is not possible?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked documentation, pyo3-build-config/src/impl_.rs around lines 854-858, and Cargo.toml around lines 97-103. Verify how multiple abi3 feature flags are selected and whether the requested default and higher-version builds can coexist; done means either correcting the documentation to match the behavior or establishing the implementation change required to support it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.