Skip to content

Commit 8ea79c9

Browse files
authored
Support Python 3.14 and bump version to 0.3.3 (#17)
* Support Python 3.14 and bump version to 0.3.3 * fix
1 parent e920257 commit 8ea79c9

6 files changed

Lines changed: 61 additions & 48 deletions

File tree

‎.github/workflows/CI.yml‎

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ on:
1010
tags:
1111
- 'v*.*.*'
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
1518
strategy:
1619
matrix:
1720
runs-on: [ ubuntu-latest, windows-latest, macos-latest ]
18-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
21+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
1922
runs-on: ${{ matrix.runs-on }}
2023
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-python@v4
24+
- uses: actions/checkout@v6
25+
- uses: actions/setup-python@v6
2326
with:
2427
python-version: ${{ matrix.python-version }}
25-
- uses: dtolnay/rust-toolchain@stable
2628
- name: Build package
2729
uses: PyO3/maturin-action@v1
2830
with:
@@ -44,17 +46,16 @@ jobs:
4446
needs: [ test ]
4547
runs-on: ubuntu-latest
4648
steps:
47-
- uses: actions/checkout@v3
48-
- uses: actions/setup-python@v4
49+
- uses: actions/checkout@v6
50+
- uses: actions/setup-python@v6
4951
with:
50-
python-version: '3.13'
51-
- uses: dtolnay/rust-toolchain@stable
52+
python-version: '3.14'
5253
- name: Build package
5354
uses: PyO3/maturin-action@v1
5455
with:
5556
command: sdist
5657
- name: Upload wheels
57-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@v7
5859
with:
5960
name: wheels-sdist
6061
path: target/wheels
@@ -65,74 +66,69 @@ jobs:
6566
runs-on: ubuntu-latest
6667
strategy:
6768
matrix:
68-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
69+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
6970
target: [ x86_64, i686 ]
7071
steps:
71-
- uses: actions/checkout@v3
72-
- uses: actions/setup-python@v4
72+
- uses: actions/checkout@v6
73+
- uses: actions/setup-python@v6
7374
with:
7475
python-version: ${{ matrix.python-version }}
75-
- uses: dtolnay/rust-toolchain@stable
7676
- name: Build package
7777
uses: PyO3/maturin-action@v1
7878
with:
7979
target: ${{ matrix.target }}
8080
manylinux: auto
8181
args: -i ${{ matrix.python-version }} --release
8282
- name: Upload wheels
83-
uses: actions/upload-artifact@v4
83+
uses: actions/upload-artifact@v7
8484
with:
8585
name: wheels-linux-${{ matrix.python-version }}-${{ matrix.target }}
8686
path: target/wheels
8787

8888
pack-windows:
89-
needs: [ test ]
9089
if: "startsWith(github.ref, 'refs/tags/')"
90+
needs: [ test ]
9191
runs-on: windows-latest
9292
strategy:
9393
matrix:
94-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
94+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
9595
target: [ x64, x86 ]
9696
steps:
97-
- uses: actions/checkout@v3
98-
- uses: actions/setup-python@v4
97+
- uses: actions/checkout@v6
98+
- uses: actions/setup-python@v6
9999
with:
100100
python-version: ${{ matrix.python-version }}
101101
architecture: ${{ matrix.target }}
102-
- uses: dtolnay/rust-toolchain@stable
103102
- name: Build package
104103
uses: PyO3/maturin-action@v1
105104
with:
106105
target: ${{ matrix.target }}
107-
manylinux: auto
108106
args: -i ${{ matrix.python-version }} --release
109107
- name: Upload wheels
110-
uses: actions/upload-artifact@v4
108+
uses: actions/upload-artifact@v7
111109
with:
112110
name: wheels-windows-${{ matrix.python-version }}-${{ matrix.target }}
113111
path: target/wheels
114112

115113
pack-macos:
116-
needs: [ test ]
117114
if: "startsWith(github.ref, 'refs/tags/')"
115+
needs: [ test ]
118116
runs-on: macos-latest
119117
strategy:
120118
matrix:
121-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
119+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
122120
steps:
123-
- uses: actions/checkout@v3
124-
- uses: actions/setup-python@v4
121+
- uses: actions/checkout@v6
122+
- uses: actions/setup-python@v6
125123
with:
126124
python-version: ${{ matrix.python-version }}
127-
- uses: dtolnay/rust-toolchain@stable
128125
- name: Build package
129126
uses: PyO3/maturin-action@v1
130127
with:
131128
target: ${{ matrix.target }}
132-
manylinux: auto
133129
args: -i ${{ matrix.python-version }} --release --target universal2-apple-darwin
134130
- name: Upload wheels
135-
uses: actions/upload-artifact@v4
131+
uses: actions/upload-artifact@v7
136132
with:
137133
name: wheels-macos-${{ matrix.python-version }}
138134
path: target/wheels
@@ -141,16 +137,15 @@ jobs:
141137
name: Release
142138
if: "startsWith(github.ref, 'refs/tags/')"
143139
needs: [ pack-sdist, pack-linux, pack-windows, pack-macos ]
140+
permissions:
141+
contents: read
142+
id-token: write
144143
runs-on: ubuntu-latest
145144
steps:
146-
- uses: actions/download-artifact@v4
145+
- uses: actions/download-artifact@v8
147146
with:
148147
pattern: wheels-*
149-
merge-multiple: true
148+
- name: Install uv
149+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
150150
- name: Publish to PyPI
151-
uses: messense/maturin-action@v1
152-
env:
153-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
154-
with:
155-
command: upload
156-
args: --skip-existing *
151+
run: uv publish wheels-*/*

‎.readthedocs.yaml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ version: 2
22

33
sphinx:
44
builder: html
5+
configuration: docs/source/conf.py
56

67
build:
7-
os: ubuntu-20.04
8+
os: ubuntu-24.04
89
tools:
9-
python: "3.9"
10-
rust: "1.64"
10+
python: latest
11+
rust: latest
1112

1213
python:
1314
install:
1415
- method: pip
1516
path: .
17+
extra_requirements:
18+
- docs

‎Cargo.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "python-vaporetto"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
edition = "2021"
55
authors = ["Koichi Akabe <vbkaisetsu@gmail.com>"]
66
description = "Python wrapper of Vaporetto tokenizer"
@@ -14,8 +14,8 @@ name = "vaporetto"
1414
crate-type = ["cdylib"]
1515

1616
[dependencies]
17-
hashbrown = "0.15.3" # MIT or Apache-2.0
17+
hashbrown = "0.17.1" # MIT or Apache-2.0
1818
ouroboros = "0.18.5" # MIT or Apache-2.0
19-
pyo3 = { version = "0.25.0", features = ["extension-module"] } # Apache-2.0
20-
vaporetto_rust = { package = "vaporetto", version = "0.6.5", features = ["kytea"] } # MIT or Apache-2.0
21-
vaporetto_rules = "0.6.5" # MIT or Apache-2.0
19+
pyo3 = { version = "0.28.3", features = ["extension-module"] } # Apache-2.0
20+
vaporetto_rust = { package = "vaporetto", version = "0.6.5", features = ["kytea"] } # MIT or Apache-2.0
21+
vaporetto_rules = "0.6.5" # MIT or Apache-2.0

‎docs/source/conf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project = 'python-vaporetto'
2-
copyright = '2022, daac-tools'
2+
copyright = '2026, daac-tools'
33
author = 'Koichi Akabe'
44

55
extensions = [

‎pyproject.toml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@ build-backend = "maturin"
44

55
[project]
66
name = "vaporetto"
7+
version = "0.3.3"
8+
description = "Python wrapper of Vaporetto tokenizer"
9+
readme = "README.md"
10+
classifiers = [
11+
"License :: OSI Approved :: Apache Software License",
12+
"License :: OSI Approved :: MIT License",
13+
"Programming Language :: Rust",
14+
"Topic :: Software Development :: Libraries",
15+
"Topic :: Text Processing",
16+
]
17+
18+
[project.optional-dependencies]
19+
docs = [
20+
"sphinx-rtd-theme",
21+
]

‎src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl Vaporetto {
271271
word_cache.insert(word.to_string(), PyString::new(py, word).into());
272272
}
273273

274-
let predictor = py.allow_threads(|| {
274+
let predictor = py.detach(|| {
275275
Predictor::new(model, predict_tags).map_err(|e| PyValueError::new_err(e.to_string()))
276276
})?;
277277

@@ -319,7 +319,7 @@ impl Vaporetto {
319319
wsconst: &str,
320320
norm: bool,
321321
) -> PyResult<Self> {
322-
let (model, _) = py.allow_threads(|| {
322+
let (model, _) = py.detach(|| {
323323
Model::read_slice(&model).map_err(|e| PyValueError::new_err(e.to_string()))
324324
})?;
325325
Self::create_internal(py, model, predict_tags, wsconst, norm)
@@ -347,7 +347,7 @@ impl Vaporetto {
347347
wsconst: &str,
348348
norm: bool,
349349
) -> PyResult<Self> {
350-
let model = py.allow_threads(|| {
350+
let model = py.detach(|| {
351351
let kytea_model =
352352
KyteaModel::read(model).map_err(|e| PyValueError::new_err(e.to_string()))?;
353353
Model::try_from(kytea_model).map_err(|e| PyValueError::new_err(e.to_string()))

0 commit comments

Comments
 (0)