Python Bindings. Again. No, really! (#55)

* - Cargo.toml:  add `crate-type = ["cdylib"] to [lib]; lacking this is what was causing the executable to be put in wheels
- pyproject.toml: add "python-binding" to features for conditional compilation
- main.rs:  `cargo build` was failing for the vtracer executable; I think the previous import scheme had an implicit dependency on the library being built and called 'vtracer'. The other way to do this would have been to add an explicit dependency to the [[bin]], but making explicit imports here solves things directly

* re-enable linux builds; features are defined in the pyproject.toml now rather than in the workflow arguments

* And publish Linux, too!
This commit is contained in:
Evan Jones
2023-09-22 13:10:04 -05:00
committed by GitHub
parent b04738fd18
commit fa1ab68ef3
4 changed files with 36 additions and 30 deletions

View File

@@ -16,28 +16,28 @@ permissions:
contents: read
jobs:
# linux:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter
# sccache: 'true'
# manylinux: auto
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
@@ -54,7 +54,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter
args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
@@ -76,7 +76,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter
args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
@@ -108,7 +108,7 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
if: "startsWith(github.ref, 'refs/tags/')"
needs: [windows, macos, sdist] # linux
needs: [windows, macos, sdist, linux]
steps:
- uses: actions/download-artifact@v3
with: