Skip to content

Commit

Permalink
Merge branch 'pip-compat' into add-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Aug 8, 2024
2 parents 71b30d9 + 7753a3e commit c9a6f3d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "entropython"
version = "1.1.0"
version = "1.1.1"
authors = ["Enkelmann <[email protected]>"]
edition = "2018"
edition = "2021"
description = "A Python module for efficient calculation of Shannon byte entropy based on Rust."
readme = "README.md"
homepage = "https://github.com/fkie-cad/entropython"
Expand All @@ -16,9 +16,5 @@ name = "libentropython"
path = "rust/lib.rs"
crate-type = ["cdylib"]

[dependencies.pyo3]
version = "0.17.1"

[features]
extension-module = ["pyo3/extension-module"]
default = ["extension-module"]
[dependencies]
pyo3 = { version = "0.22.2", features = ["extension-module"] }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ To install the version from pypi.org run
pip install entropython
```

To install the newest version from this repository run
To install the latest version directly from GitHub run
```shell
pip git+https://github.com/fkie-cad/entropython
```

(you need to [have rust installed](https://www.rust-lang.org/tools/install))
or check out the repository and run
```shell
pip install .
Expand Down
4 changes: 2 additions & 2 deletions rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn metric_entropy(bytes: &[u8]) -> f64 {
/// This module implements functions to compute the Shannon byte entropy of a byte array.
/// The computation itself is implemented in Rust for faster runtime.
#[pymodule]
fn libentropython(_py: Python, m: &PyModule) -> PyResult<()> {
fn libentropython(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(shannon_entropy, m)?)?;
m.add_function(wrap_pyfunction!(metric_entropy, m)?)?;
Ok(())
Expand All @@ -60,4 +60,4 @@ mod tests {
assert!(shannon_entropy(&bytes) > 7.99f64);
assert!(shannon_entropy(&bytes) <= 8f64);
}
}
}

0 comments on commit c9a6f3d

Please sign in to comment.