Skip to content

Commit

Permalink
GH-185: fix error in pyproject.toml (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Nov 17, 2021
1 parent 0f73893 commit 2010d17
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 216 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-pypi-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -68,4 +68,4 @@ jobs:
working-directory: ./extensions/underthesea_core
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_UNDERTHESEA_CORE_API_TOKEN }}
run: poetry run maturin publish --username __token__
run: poetry run maturin publish --username __token__ --interpreter python${{ matrix.python-version }}
25 changes: 17 additions & 8 deletions extensions/underthesea_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
[package]
name = "underthesea_core"
version = "0.0.4-alpha.6"
version = "0.0.4-alpha.8"
homepage = "https://github.com/undertheseanlp/underthesea/"
repository = "https://github.com/undertheseanlp/underthesea/"
authors = ["Vu Anh <[email protected]>"]
description = "Underthesea Core (fast & fun)"
license = "GPL-3.0"
edition = "2021"
readme = "README.md"
repository = "https://github.com/undertheseanlp/underthesea/"
homepage = "https://github.com/undertheseanlp/underthesea/"
description = "Underthesea Core (fast & fun)"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
exclude = ["rust-toolchain", "target/*", "Cargo.lock", "benches/*.txt"]

[lib]
name = "underthesea_core"
path = "src/lib.rs"
crate-type = ["cdylib"]

[[bench]]
name = "lab"
harness = false

[dependencies]
serde = { version = "1.0", features = [ "derive" ] }
regex = "1"
rayon = "1.5"

[dependencies.pyo3]
version = "0.15.0"
features = ["extension-module"]

[lib]
name = "underthesea_core"
crate-type = ["cdylib"]
[dev-dependencies]
criterion = "0.3.5"
41 changes: 41 additions & 0 deletions extensions/underthesea_core/benches/lab.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
extern crate rayon;
extern crate criterion;

use std::time::Duration;
use rayon::prelude::*;
use criterion::*;

fn fibonacci(n: u32) -> u32 {
match n {
0 => 1,
1 => 1,
_ => fibonacci(n - 1) + fibonacci(n - 2),
}
}

fn f1() {
let mut arr: [u32; 2] = [10, 100];
arr.par_iter_mut().map(|n| fibonacci(*n));
return;
}

fn f2() {
let mut arr: [u32; 2] = [10, 100];
arr.map(|n| fibonacci(n));
return;
}


fn criterion_benchmark(c: &mut Criterion){
let mut group = c.benchmark_group("abc");
group.bench_function("my-function", |b| b.iter(|| f1()));
group.finish();
}

criterion_group! {
name = benches;
config = Criterion::default().sample_size(10);
targets = criterion_benchmark
}

criterion_main!(benches);
3 changes: 1 addition & 2 deletions extensions/underthesea_core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "underthesea_core"
version = "0.0.4-alpha.6"
version = "0.0.4-alpha.8"
authors = ["Vu Anh <[email protected]>"]
description = "Underthesea Core (fast & fun)"
license = "GPL-3.0"
Expand All @@ -15,5 +15,4 @@ python = "^3.5"
maturin = "==0.9.4"

[build-system]
requires = ["==0.9.4"]
build-backend = "maturin"
Loading

0 comments on commit 2010d17

Please sign in to comment.