Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Support Python3.10 #83

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, "3.10"]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manylinux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- 3.7
- 3.8
- 3.9
- "3.10"
container:
image: quay.io/pypa/manylinux2010_x86_64
env:
Expand Down
30 changes: 15 additions & 15 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#![allow(clippy::deprecated)]
use pyo3::prelude::*;
use tokenizations::{get_alignments, get_charmap, Alignment, CharMap};
use tokenizations::{
get_alignments as get_alignments_orig, get_charmap as get_charmap_orig, Alignment, CharMap,
};

#[pyfunction]
pub fn get_alignments(a: Vec<&str>, b: Vec<&str>) -> PyResult<(Alignment, Alignment)> {
Ok(get_alignments_orig(&a, &b))
}

#[pyfunction]
pub fn get_charmap(a: &str, b: &str) -> PyResult<(CharMap, CharMap)> {
Ok(get_charmap_orig(a, b))
}

#[pymodule]
fn tokenizations(_py: Python, m: &PyModule) -> PyResult<()> {
m.add("__version__", "0.8.4")?;

#[pyfn(m, "get_alignments")]
pub fn get_alignments_py(
_py: Python,
a: Vec<&str>,
b: Vec<&str>,
) -> PyResult<(Alignment, Alignment)> {
Ok(get_alignments(&a, &b))
}

#[pyfn(m, "get_charmap")]
pub fn get_charmap_py(_py: Python, a: &str, b: &str) -> PyResult<(CharMap, CharMap)> {
Ok(get_charmap(a, b))
}
m.add_function(wrap_pyfunction!(get_alignments, m)?)?;
m.add_function(wrap_pyfunction!(get_charmap, m)?)?;

Ok(())
}