Skip to content

Commit

Permalink
Release cargo packages (#140)
Browse files Browse the repository at this point in the history
* release all packages

* fix paths

* more fixeS

* fix python

* bumpt versions

* fix kornia-io dep

* try dry-run

* use cross

* attempt to use cross

* release actions

* install deps

* try again

* no dependencieS

* install cross

* release manual script

* bump to 0.1.6-rc.5
  • Loading branch information
edgarriba authored Sep 19, 2024
1 parent ac1cdbd commit a652662
Show file tree
Hide file tree
Showing 43 changed files with 152 additions and 148 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/rust_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
- x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -24,9 +23,10 @@ jobs:
with:
command: login
args: ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }}
- name: Cargo Publish
uses: actions-rs/cargo@v1
with:
command: publish
args: --verbose --target ${{ matrix.target }} --all-features
use-cross: true
- name: Publish packages into crates.io
run: |
cargo publish -p kornia-core --token ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }}
cargo publish -p kornia-image --token ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }}
cargo publish -p kornia-io --token ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }} --all-features
cargo publish -p kornia-imgproc --token ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }}
cargo publish -p kornia --token ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }} --all-features
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/kornia/kornia-rs"
rust-version = "1.76"
version = "0.1.6+dev"
version = "0.1.6-rc.5"

[workspace.dependencies]
kornia-core = { path = "crates/kornia-core", version = "0.1.6+dev" }
kornia-image = { path = "crates/kornia-image", version = "0.1.6+dev" }
kornia-io = { path = "crates/kornia-io", version = "0.1.6+dev" }
kornia-imgproc = { path = "crates/kornia-imgproc", version = "0.1.6+dev" }
kornia = { path = "crates/kornia", version = "0.1.6+dev" }
# NOTE: remember to update the kornia-py package version in `kornia-py/Cargo.toml` when updating the Rust package version
kornia-core = { path = "crates/kornia-core", version = "0.1.6-rc.5" }
kornia-image = { path = "crates/kornia-image", version = "0.1.6-rc.5" }
kornia-io = { path = "crates/kornia-io", version = "0.1.6-rc.5" }
kornia-imgproc = { path = "crates/kornia-imgproc", version = "0.1.6-rc.5" }
kornia = { path = "crates/kornia", version = "0.1.6-rc.5" }
4 changes: 0 additions & 4 deletions crates/kornia-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ arrow-buffer = "53.0.0"
num-traits = "0.2"
serde = { version = "1", features = ["derive"] }
thiserror = "1"


[dev-dependencies]
kornia.workspace = true
30 changes: 15 additions & 15 deletions crates/kornia-core/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub(crate) fn get_strides_from_shape<const N: usize>(shape: [usize; N]) -> [usiz
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
/// let t = Tensor::<u8, 2>::new_uninitialized([2, 2], CpuAllocator).unwrap();
Expand Down Expand Up @@ -186,7 +186,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
/// let t = Tensor::<u8, 2>::from_shape_vec([2, 2], data, CpuAllocator).unwrap();
Expand Down Expand Up @@ -225,7 +225,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: [u8; 4] = [1, 2, 3, 4];
/// let t = Tensor::<u8, 2>::from_shape_slice([2, 2], &data, CpuAllocator).unwrap();
Expand Down Expand Up @@ -261,7 +261,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let t = Tensor::<u8, 1>::from_shape_val([4], 0, CpuAllocator);
/// assert_eq!(t.as_slice(), vec![0, 0, 0, 0]);
Expand Down Expand Up @@ -301,7 +301,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let t = Tensor::<u8, 1>::from_shape_fn([4], |[i]| i as u8, CpuAllocator);
/// assert_eq!(t.as_slice(), vec![0, 1, 2, 3]);
Expand Down Expand Up @@ -374,7 +374,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
///
Expand Down Expand Up @@ -406,7 +406,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
///
Expand Down Expand Up @@ -441,7 +441,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
///
Expand Down Expand Up @@ -543,7 +543,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
/// let t = Tensor::<u8, 1>::from_shape_vec([4], data, CpuAllocator).unwrap();
Expand Down Expand Up @@ -628,7 +628,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data: Vec<u8> = vec![1, 2, 3, 4];
/// let t = Tensor::<u8, 1>::from_shape_vec([4], data, CpuAllocator).unwrap();
Expand Down Expand Up @@ -667,7 +667,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data1: Vec<u8> = vec![1, 2, 3, 4];
/// let t1 = Tensor::<u8, 1>::from_shape_vec([4], data1, CpuAllocator).unwrap();
Expand Down Expand Up @@ -732,7 +732,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data1: Vec<u8> = vec![1, 2, 3, 4];
/// let t1 = Tensor::<u8, 1>::from_shape_vec([4], data1, CpuAllocator).unwrap();
Expand Down Expand Up @@ -765,7 +765,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data1: Vec<u8> = vec![1, 2, 3, 4];
/// let t1 = Tensor::<u8, 1>::from_shape_vec([4], data1, CpuAllocator).unwrap();
Expand Down Expand Up @@ -798,7 +798,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data1: Vec<u8> = vec![1, 2, 3, 4];
/// let t1 = Tensor::<u8, 1>::from_shape_vec([4], data1, CpuAllocator).unwrap();
Expand Down Expand Up @@ -831,7 +831,7 @@ where
/// # Example
///
/// ```
/// use kornia::core::{Tensor, CpuAllocator};
/// use kornia_core::{Tensor, CpuAllocator};
///
/// let data1: Vec<u8> = vec![1, 2, 3, 4];
/// let t1 = Tensor::<u8, 1>::from_shape_vec([4], data1, CpuAllocator).unwrap();
Expand Down
4 changes: 0 additions & 4 deletions crates/kornia-image/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@ version.workspace = true
kornia-core.workspace = true

# external
ndarray = { version = "0.15", features = ["rayon"] }
num-traits = "0.2"
thiserror = "1"

[dev-dependencies]
kornia.workspace = true
4 changes: 0 additions & 4 deletions crates/kornia-image/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ pub enum ImageError {
#[error("Image data is not contiguous")]
ImageDataNotContiguous,

/// Error when shape is not valid.
#[error("Invalid shape")]
InvalidShape(#[from] ndarray::ShapeError),

/// Error when the image shape is not valid.
#[error("Invalid image shape")]
InvalidImageShape(#[from] kornia_core::TensorError),
Expand Down
10 changes: 5 additions & 5 deletions crates/kornia-image/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::error::ImageError;
/// # Examples
///
/// ```
/// use kornia::image::ImageSize;
/// use kornia_image::ImageSize;
///
/// let image_size = ImageSize {
/// width: 10,
Expand Down Expand Up @@ -106,7 +106,7 @@ where
/// # Examples
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia_image::{Image, ImageSize};
///
/// let image = Image::<u8, 3>::new(
/// ImageSize {
Expand Down Expand Up @@ -155,7 +155,7 @@ where
/// # Examples
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia_image::{Image, ImageSize};
///
/// let image = Image::<u8, 3>::from_size_val(
/// ImageSize {
Expand Down Expand Up @@ -240,7 +240,7 @@ where
/// # Examples
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia_image::{Image, ImageSize};
///
/// let image = Image::<f32, 2>::from_size_val(
/// ImageSize {
Expand Down Expand Up @@ -315,7 +315,7 @@ where
/// # Examples
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia_image::{Image, ImageSize};
///
/// let data = vec![0u8, 0, 255, 0, 0, 255];
///
Expand Down
4 changes: 2 additions & 2 deletions crates/kornia-image/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use crate::{Image, ImageError};
/// Example:
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::image::ops::cast_and_scale;
/// use kornia_image::{Image, ImageSize};
/// use kornia_image::ops::cast_and_scale;
///
/// let image = Image::<u8, 1>::new(
/// ImageSize {
Expand Down
1 change: 0 additions & 1 deletion crates/kornia-imgproc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ thiserror = "1"

[dev-dependencies]
kornia-io.workspace = true
kornia.workspace = true

criterion = "0.5"
image = "0.25.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/kornia-imgproc/benches/bench_color.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

use kornia::imgproc::color::gray_from_rgb;
use kornia_image::Image;
use kornia_imgproc::color::gray_from_rgb;
use rayon::prelude::*;

// vanilla version
Expand Down
4 changes: 2 additions & 2 deletions crates/kornia-imgproc/benches/bench_flip.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

use kornia::image::Image;
use kornia::imgproc::flip;
use kornia_image::Image;
use kornia_imgproc::flip;

use rayon::{
iter::{IndexedParallelIterator, ParallelIterator},
Expand Down
3 changes: 2 additions & 1 deletion crates/kornia-imgproc/benches/bench_metrics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

use kornia::{image::Image, imgproc::metrics};
use kornia_image::Image;
use kornia_imgproc::metrics;

fn bench_mse(c: &mut Criterion) {
let mut group = c.benchmark_group("mse");
Expand Down
4 changes: 2 additions & 2 deletions crates/kornia-imgproc/benches/bench_resize.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

use kornia::image::{Image, ImageSize};
use kornia::imgproc::{interpolation::InterpolationMode, resize};
use kornia_image::{Image, ImageSize};
use kornia_imgproc::{interpolation::InterpolationMode, resize};

fn resize_image_crate(image: Image<u8, 3>, new_size: ImageSize) -> Image<u8, 3> {
let image_data = image.as_slice();
Expand Down
11 changes: 4 additions & 7 deletions crates/kornia-imgproc/benches/bench_warp.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

use kornia::{
image::Image,
imgproc::{
interpolation::InterpolationMode,
warp::{get_rotation_matrix2d, warp_affine},
},
use kornia_image::Image;
use kornia_imgproc::{
interpolation::InterpolationMode,
warp::{get_rotation_matrix2d, warp_affine, warp_perspective},
};
use kornia_imgproc::warp::warp_perspective;

fn bench_warp_affine(c: &mut Criterion) {
let mut group = c.benchmark_group("WarpAffine");
Expand Down
4 changes: 2 additions & 2 deletions crates/kornia-imgproc/src/color/gray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const BW: f64 = 0.114;
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::color::gray_from_rgb;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::color::gray_from_rgb;
///
/// let image = Image::<f32, 3>::new(
/// ImageSize {
Expand Down
4 changes: 2 additions & 2 deletions crates/kornia-imgproc/src/color/hsv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use kornia_image::{Image, ImageError};
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::color::hsv_from_rgb;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::color::hsv_from_rgb;
///
/// let image = Image::<f32, 3>::new(
/// ImageSize {
Expand Down
8 changes: 4 additions & 4 deletions crates/kornia-imgproc/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use kornia_image::{Image, ImageError};
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::core::std_mean;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::core::std_mean;
///
/// let image = Image::<u8, 3>::new(
/// ImageSize {
Expand Down Expand Up @@ -81,8 +81,8 @@ pub fn std_mean(image: &Image<u8, 3>) -> (Vec<f64>, Vec<f64>) {
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::core::bitwise_and;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::core::bitwise_and;
///
/// let image = Image::<u8, 3>::new(
/// ImageSize {
Expand Down
8 changes: 4 additions & 4 deletions crates/kornia-imgproc/src/flip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use rayon::{
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::flip::horizontal_flip;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::flip::horizontal_flip;
///
/// let image = Image::<f32, 3>::new(
/// ImageSize {
Expand Down Expand Up @@ -84,8 +84,8 @@ where
/// # Example
///
/// ```
/// use kornia::image::{Image, ImageSize};
/// use kornia::imgproc::flip::vertical_flip;
/// use kornia_image::{Image, ImageSize};
/// use kornia_imgproc::flip::vertical_flip;
///
/// let image = Image::<f32, 3>::new(
/// ImageSize {
Expand Down
Loading

0 comments on commit a652662

Please sign in to comment.