Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Pyo3 0.21 #7

Merged
merged 7 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
92 changes: 65 additions & 27 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,110 @@
# This file is autogenerated by maturin v1.5.0
# To update, run
#
# maturin generate-ci github
#
name: CI

on:
# push:
# branches:
# - main
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, i686, aarch64]
target: [ x86_64, i686, aarch64 ]
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
command: build
args: --release --sdist -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-${{ matrix.target }}
path: dist

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist --find-interpreter
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows
path: dist

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
target: universal2-apple-darwin
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-universal2
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: [macos, windows, linux]
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux, windows, macos, sdist ]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *
args: --non-interactive --skip-existing wheels-*/*
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "rbloom"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.20", features = [
pyo3 = { version = "0.21", features = [
"extension-module",
"abi3-py37",
] } # stable ABI with minimum Python version 3.7
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[project]
Expand Down
5 changes: 3 additions & 2 deletions rbloom.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import Any, Callable, Iterable, Union, final


Expand All @@ -24,14 +25,14 @@ class Bloom:

# load from file, see section "Persistence"
@classmethod
def load(cls, filepath: str, hash_func: Callable[[Any], int]) -> Bloom: ...
def load(cls, filepath: Union[str, bytes, os.PathLike], hash_func: Callable[[Any], int]) -> Bloom: ...

# load from bytes(), see section "Persistence"
@classmethod
def load_bytes(cls, data: bytes, hash_func: Callable[[Any], int]) -> Bloom: ...

# save to file, see section "Persistence"
def save(self, filepath: str) -> None: ...
def save(self, filepath: Union[str, bytes, os.PathLike]) -> None: ...

# save to a bytes(), see section "Persistence"
def save_bytes(self) -> bytes: ...
Expand Down