Skip to content

Commit f91b7f6

Browse files
Hide rust module (#321)
The rust module has a hidden (_) name under the top module encoderfile, so it will be ignored by repl and ides (ideally). Closes #298
1 parent 8c432de commit f91b7f6

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

encoderfile-py/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2024"
77

88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99
[lib]
10-
name = "encoderfile"
10+
name = "_core"
1111
crate-type = ["cdylib"]
1212

1313
[dependencies]

encoderfile-py/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Homepage = "https://mozilla-ai.github.io/encoderfile"
2525

2626
[tool.maturin]
2727
python-source = "python"
28+
module-name = "encoderfile._core"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# type: ignore
2-
from .encoderfile import * # noqa # type: ignore
3-
from .enums import * # noqa # type: ignore
2+
from ._core import * # noqa: F403
3+
from .enums import * # noqa: F403
44

5-
__doc__ = encoderfile.__doc__ # noqa # type: ignore
6-
if hasattr(encoderfile, "__all__"): # noqa # type: ignore
7-
__all__ = encoderfile.__all__ # noqa # type:ignore
5+
__doc__ = _core.__doc__ # noqa: F405
6+
if hasattr(_core, "__all__"): # noqa: F405
7+
__all__ = _core.__all__ # noqa: F405

encoderfile-py/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use pyo3::prelude::*;
33
mod builder;
44

55
/// A Python module implemented in Rust.
6-
#[pymodule]
6+
#[pymodule(name = "_core")]
77
mod encoderfile {
88
#[pymodule_export]
99
use super::builder::PyTargetSpec;

0 commit comments

Comments
 (0)