start using semver, fix doc.rs issue

This commit is contained in:
w.pomp
2026-02-23 19:54:58 +01:00
parent d2c725440c
commit 705ca16379
5 changed files with 17 additions and 13 deletions

View File

@@ -1,13 +1,13 @@
[package] [package]
name = "ndbioimage" name = "ndbioimage"
version = "2026.1.2" version = "0.1.0"
edition = "2024" edition = "2024"
rust-version = "1.85.1" rust-version = "1.87.0"
authors = ["Wim Pomp <w.pomp@nki.nl>"] authors = ["Wim Pomp <w.pomp@nki.nl>"]
license = "MIT" license = "MIT"
description = "Read bio image formats using the bio-formats java package." description = "Read bio image formats using the bio-formats java package."
homepage = "https://github.com/wimpomp/ndbioimage/tree/rs" homepage = "https://git.wimpomp.nl/wim/ndbioimage/src/branch/rs"
repository = "https://github.com/wimpomp/ndbioimage/tree/rs" repository = "https://git.wimpomp.nl/wim/ndbioimage/src/branch/rs"
documentation = "https://docs.rs/ndbioimage" documentation = "https://docs.rs/ndbioimage"
readme = "README.md" readme = "README.md"
keywords = ["bioformats", "imread", "ndarray", "metadata"] keywords = ["bioformats", "imread", "ndarray", "metadata"]
@@ -21,6 +21,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies] [dependencies]
clap = { version = "4", features = ["derive"] } clap = { version = "4", features = ["derive"] }
color-eyre = { version = "0.6", optional = true }
ffmpeg-sidecar = { version = "2", optional = true } ffmpeg-sidecar = { version = "2", optional = true }
itertools = "0.14" itertools = "0.14"
indexmap = { version = "2", features = ["serde"] } indexmap = { version = "2", features = ["serde"] }
@@ -28,21 +29,21 @@ indicatif = { version = "0.18", features = ["rayon"], optional = true }
j4rs = "0.24" j4rs = "0.24"
ndarray = { version = "0.17", features = ["serde"] } ndarray = { version = "0.17", features = ["serde"] }
num = "0.4" num = "0.4"
numpy = { version = "0.27", optional = true } numpy = { version = "0.28", optional = true }
ordered-float = "5" ordered-float = "5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
serde = { version = "1", features = ["rc"] } serde = { version = "1", features = ["rc"] }
serde_json = { version = "1", optional = true } serde_json = { version = "1", optional = true }
serde_with = "3" serde_with = "3"
tiffwrite = { version = "2025.12.0", optional = true} tiffwrite = { version = ">=2026.1.1, <2026.2.0", optional = true}
thread_local = "1" thread_local = "1"
ome-metadata = "0.4" ome-metadata = "0.4"
lazy_static = "1" lazy_static = "1"
thiserror = "2" thiserror = "2"
[dependencies.pyo3] [dependencies.pyo3]
version = "0.27" version = "0.28"
features = ["extension-module", "abi3-py310", "generate-import-lib", "anyhow"] features = ["extension-module", "abi3-py310", "eyre", "generate-import-lib"]
optional = true optional = true
[dev-dependencies] [dev-dependencies]
@@ -60,7 +61,7 @@ retry = "2"
# Enables formats for which code in bioformats with a GPL license is needed # Enables formats for which code in bioformats with a GPL license is needed
gpl-formats = [] gpl-formats = []
# Enables python ffi using pyO3 # Enables python ffi using pyO3
python = ["dep:pyo3", "dep:numpy", "dep:serde_json"] python = ["dep:pyo3", "dep:numpy", "dep:serde_json", "dep:color-eyre"]
# Enables writing as tiff # Enables writing as tiff
tiff = ["dep:tiffwrite", "dep:indicatif", "dep:rayon"] tiff = ["dep:tiffwrite", "dep:indicatif", "dep:rayon"]
# Enables writing as mp4 using ffmpeg # Enables writing as mp4 using ffmpeg

View File

@@ -14,6 +14,8 @@ it on the fly to the image.
Currently, it supports imagej tif files, czi files, micromanager tif sequences and anything Currently, it supports imagej tif files, czi files, micromanager tif sequences and anything
[bioformats](https://www.openmicroscopy.org/bio-formats/) can handle. [bioformats](https://www.openmicroscopy.org/bio-formats/) can handle.
To transition to semver, versions before 0.1.0 were yanked from crates.io.
## Installation ## Installation
``` ```

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
mod bioformats; mod bioformats;

View File

@@ -15,7 +15,7 @@ impl Metadata for Ome {
fn get_image(&self) -> Option<&Image> { fn get_image(&self) -> Option<&Image> {
if let Some(image) = &self.image.first() { if let Some(image) = &self.image.first() {
Some(&image) Some(image)
} else { } else {
None None
} }

View File

@@ -19,7 +19,7 @@ use std::sync::Arc;
impl From<crate::error::Error> for PyErr { impl From<crate::error::Error> for PyErr {
fn from(err: crate::error::Error) -> PyErr { fn from(err: crate::error::Error) -> PyErr {
PyErr::new::<PyValueError, _>(err.to_string()) color_eyre::eyre::Report::from(err).into()
} }
} }
@@ -49,7 +49,7 @@ impl ViewConstructor {
} }
} }
#[pyclass(subclass, module = "ndbioimage.ndbioimage_rs")] #[pyclass(subclass, from_py_object, module = "ndbioimage.ndbioimage_rs")]
#[pyo3(name = "View")] #[pyo3(name = "View")]
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
struct PyView { struct PyView {
@@ -982,6 +982,7 @@ fn py_download_bioformats(gpl_formats: bool) -> PyResult<()> {
#[pymodule] #[pymodule]
#[pyo3(name = "ndbioimage_rs")] #[pyo3(name = "ndbioimage_rs")]
fn ndbioimage_rs(m: &Bound<PyModule>) -> PyResult<()> { fn ndbioimage_rs(m: &Bound<PyModule>) -> PyResult<()> {
color_eyre::install()?;
m.add_class::<PyView>()?; m.add_class::<PyView>()?;
m.add_class::<ViewConstructor>()?; m.add_class::<ViewConstructor>()?;
m.add_function(wrap_pyfunction!(py_download_bioformats, m)?)?; m.add_function(wrap_pyfunction!(py_download_bioformats, m)?)?;