Skip to content

Commit 6e5d67d

Browse files
committed
refactor: unify Rust and Python module naming under 'werx'
1 parent f82dfd3 commit 6e5d67d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ build-backend = "maturin"
2727
[tool.maturin]
2828
python-source = "src"
2929
manifest-path = "werx-core/Cargo.toml"
30-
module-name = "werx.werx_rust" # <-- This means the Python module will be accessible as werx.werx_rust
30+
#module-name = "werx.werx_rust" # <-- This means the Python module will be accessible as werx.werx_rust
3131
#module-name = "werx_rust" # <-- Match the import path in wer.py
32+
module-name = "werx"
3233
bindings = "pyo3"
3334
include = ["LICENSE", "NOTICE", "README.md", "src/**"]
3435

src/werx/wer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from .werx_rust import wer as _wer
1+
#from .werx_rust import wer as _wer
2+
from .werx import wer as _wer
23

34
def wer(ref: str | list[str], hyp: str | list[str]) -> float:
45
return _wer(ref, hyp)

werx-core/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[package]
2-
name = "werx_rust" # <-- Rust crate name
2+
#name = "werx_rust" # <-- Rust crate name
3+
name = "werx" # <-- Rust crate name
34
version = "0.1.1"
45
edition = "2021"
56
resolver = "2" # <-- Avoid compiling unnecessary features from dependencies.
67

78
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
89
[lib]
9-
#name = "werx" # <-- This is the name of the compiled Python module
10-
name = "werx_rust" # <-- Match the module-name in pyproject.toml
10+
name = "werx" # <-- This is the name of the compiled Python module
11+
#name = "werx_rust" # <-- Match the module-name in pyproject.toml
1112
crate-type = ["cdylib"]
1213

1314
[dependencies]

0 commit comments

Comments
 (0)