Skip to content

wrong abi3 tag for "conditional cargo features" enabled pyo3 abi3 feature #3028

@trim21

Description

@trim21

Bug Description

this work, build -cp311-abi3-win_amd64.whl

features = [
    # we need PyBuffer which is stable since 3.11
    "pyo3/abi3-py311"
    # { feature = "pyo3/abi3-py311", python-version = ">=3.11" },
]
❯❯ ~/proj/bencode-rs (master ~4) maturin build --locked --release -i '3.11'
📦 Including license file `LICENSE`
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support
⚠️  Warning: Failed to determine python platform
⚠️  Warning: Failed to determine python platform
🐍 Not using a specific python interpreter (automatically generating windows import library)
📡 Using build options features from pyproject.toml
    Finished `release` profile [optimized] target(s) in 0.08s
📦 Built wheel for abi3 Python ≥ 3.11 to C:\Users\Trim21\proj\bencode-rs\target\wheels\bencode_rs-0.0.8-cp311-abi3-win_amd64.whl

this doesn't:

features = [
    # we need PyBuffer which is stable since 3.11
    # "pyo3/abi3-py311"
    { feature = "pyo3/abi3-py311", python-version = ">=3.11" },
]
❯❯ ~/proj/bencode-rs (master ~4) maturin build --locked --release -i '3.11'
📦 Including license file `LICENSE`
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
⚠️  Warning: Failed to determine python platform
⚠️  Warning: Failed to determine python platform
🐍 Found CPython 3.11
📡 Using build options features from pyproject.toml
    Finished `release` profile [optimized] target(s) in 0.15s
📦 Built wheel for CPython 3.11 to C:\Users\Trim21\proj\bencode-rs\target\wheels\bencode_rs-0.0.8-cp311-cp311-win_amd64.whl

Your maturin version (maturin --version)

maturin 1.12.4

Your Python version (python -V)

no system python, with pyo3/generate-import-lib enabled

Your pip version (pip -V)

no pip installed

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  • git clone --branch conditional-abi3 https://github.com/trim21/bencode-rs
  • maturin build --out dist --locked --release -i '3.11' -i '3.10'
  • ls -ahl dist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions