Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 34 additions & 43 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- main
- 'later-version-support-test'
tags:
- 'v*.*.*'

Expand All @@ -15,11 +16,11 @@ jobs:
strategy:
matrix:
runs-on: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -41,116 +42,106 @@ jobs:

pack-sdist:
needs: [ test ]
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/later-version-support-test'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Build package
uses: PyO3/maturin-action@v1
with:
command: sdist
- name: Upload wheels
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.runs-on }}
name: sdist
path: target/wheels

pack-linux:
needs: [ test ]
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/later-version-support-test'"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
target: [ x86_64, i686 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'
- uses: dtolnay/rust-toolchain@stable
- name: Build package
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: -i ${{ matrix.python-version }} --release
args: -i 3.10 --release
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.runs-on }}
name: wheels-linux-${{ matrix.target }}
path: target/wheels

pack-windows:
needs: [ test ]
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/later-version-support-test'"
runs-on: windows-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
target: [ x64, x86 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'
architecture: ${{ matrix.target }}
- uses: dtolnay/rust-toolchain@stable
- name: Build package
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: -i ${{ matrix.python-version }} --release
args: -i 3.10 --release
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.runs-on }}
name: wheels-windows-${{ matrix.target }}
path: target/wheels

pack-macos:
needs: [ test ]
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/later-version-support-test'"
runs-on: macos-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'
- uses: dtolnay/rust-toolchain@stable
- name: Build package
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: -i ${{ matrix.python-version }} --release --universal2
args: -i 3.10 --release --universal2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.runs-on }}
name: wheels-macos-universal2
path: target/wheels

release:
name: Release
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/later-version-support-test'"
needs: [ pack-sdist, pack-linux, pack-windows, pack-macos ]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Show downloaded artifacts
run: find . -maxdepth 3 -type f | sort
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Cargo.lock
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ crate-type = ["cdylib"]
[dependencies]
hashbrown = "0.13.2" # MIT or Apache-2.0
ouroboros = "0.15.6" # MIT or Apache-2.0
pyo3 = { version = "0.18.2", features = ["extension-module"] } # Apache-2.0
pyo3 = { version = "0.18.2", features = ["extension-module", "abi3-py310"] } # Apache-2.0
vibrato_rust = { package = "vibrato", version = "0.5.0", default-features = false } # MIT or Apache-2.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Check the version number as shown below to use compatible models:
```python
>>> import vibrato
>>> vibrato.VIBRATO_VERSION
'0.5.1'
'0.5.2'

```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can check the version number as shown below to use compatible models:

>>> import vibrato
>>> vibrato.VIBRATO_VERSION
'0.5.1'
'0.5.2'

Examples:

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
requires = ["maturin>=1,<2"]
build-backend = "maturin"

[project]
name = "vibrato"
dynamic = ["version"]
requires-python = ">=3.10"
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ struct TokenIterator {

#[pymethods]
impl TokenIterator {
fn __iter__(self_: PyRef<Self>) -> Py<Self> {
self_.into()
}

fn __next__(&mut self, py: Python) -> Option<Token> {
if self.index < self.len {
let index = self.index;
Expand Down
Loading