Unverified Commit fff67afa authored by Niklas Hambüchen's avatar Niklas Hambüchen Committed by GitHub
Browse files

Merge pull request #297876 from chpatrick/kornia-0.7.2

python311Packages.kornia: 0.7.1 -> 0.7.2
parents 8e1bfd5a a5ed5b19
Loading
Loading
Loading
Loading
+1598 −0

File added.

Preview size limit exceeded, changes collapsed.

+56 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, buildPythonPackage
, rustPlatform
, cmake
, nasm
, substituteAll
}:

buildPythonPackage rec {
  pname = "kornia-rs";
  version = "0.1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "kornia";
    repo = "kornia-rs";
    rev = "refs/tags/v${version}";
    hash = "sha256-7toCMaHzFAzm6gThVLBxKLgQVgFJatdJseDlfdeS8RE=";
  };

  nativeBuildInputs = [
    rustPlatform.maturinBuildHook
    rustPlatform.cargoSetupHook
    cmake # Only for dependencies.
    nasm # Only for dependencies.
  ];

  cargoRoot = "py-kornia";
  cargoDeps = rustPlatform.importCargoLock {
    lockFile = ./Cargo.lock;
  };

  # The path dependency doesn't vendor the dependencies correctly, so get kornia-rs from crates instead.
  patches = [
    (substituteAll {
      src = ./kornia-rs-from-crates.patch;
      inherit version;
    })
  ];

  prePatch = ''
    cp ${./Cargo.lock} py-kornia/Cargo.lock
  '';

  maturinBuildFlags = [ "-m" "py-kornia/Cargo.toml" ];

  dontUseCmakeConfigure = true; # We only want to use CMake to build some Rust dependencies.

  meta = with lib; {
    homepage = "https://github.com/kornia/kornia-rs";
    description = "Python bindings to Low-level Computer Vision library in Rust";
    license = licenses.asl20;
    maintainers = with maintainers; [ chpatrick ];
  };
}
+12 −0
Original line number Diff line number Diff line
diff --git a/py-kornia/Cargo.toml b/py-kornia/Cargo.toml
index e0563f3..e192654 100644
--- a/py-kornia/Cargo.toml
+++ b/py-kornia/Cargo.toml
@@ -9,6 +9,6 @@ crate-type = ["cdylib"]

 [dependencies]
 anyhow = "1.0.80"
-kornia-rs = { path = ".." }
+kornia-rs = { version = "@version@" }
 pyo3 = { version = "0.20", features = ["extension-module"] }
 numpy = { version = "0.20.0" }
+4 −3
Original line number Diff line number Diff line
@@ -4,11 +4,12 @@
, pythonOlder
, packaging
, torch
, kornia-rs
}:

buildPythonPackage rec {
  pname = "kornia";
  version = "0.7.1";
  version = "0.7.2";
  format = "pyproject";

  disabled = pythonOlder "3.8";
@@ -17,10 +18,11 @@ buildPythonPackage rec {
    owner = pname;
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-gHMrA4Uzazpw4TdswrXdoZG4+ek5g+wtLXNmhH3SlOM=";
    hash = "sha256-DmXttvKoLqny0mt3SUonidNxDkNX7N0LdTxy/H32R/4=";
  };

  propagatedBuildInputs = [
    kornia-rs
    packaging
    torch
  ];
@@ -39,7 +41,6 @@ buildPythonPackage rec {
    "kornia.metrics"
    "kornia.morphology"
    "kornia.tracking"
    "kornia.testing"
    "kornia.utils"
  ];

+2 −0
Original line number Diff line number Diff line
@@ -6415,6 +6415,8 @@ self: super: with self; {
  kornia = callPackage ../development/python-modules/kornia { };
  kornia-rs = callPackage ../development/python-modules/kornia-rs { };
  krakenex = callPackage ../development/python-modules/krakenex { };
  krfzf-py = callPackage ../development/python-modules/krfzf-py { };