diff --git a/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix b/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix index 9af17aa5159..31730d6ff2d 100644 --- a/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix +++ b/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix @@ -17,5 +17,9 @@ callPackage ../../../tools/rust/maturin/pyo3-test/generic.nix { rust.rustc ]); - sourceRoot = "source/examples/word-count"; + preConfigure = '' + # sourceRoot puts Cargo.lock in the wrong place due to the + # example setup. + cd examples/word-count + ''; } diff --git a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix index f82c988fc51..84ca2ddf77f 100644 --- a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix +++ b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix @@ -10,7 +10,7 @@ , buildAndTestSubdir ? null , format ? "pyproject" -, sourceRoot ? "source" +, preConfigure ? "" }: python3Packages.buildPythonPackage rec { @@ -25,14 +25,14 @@ python3Packages.buildPythonPackage rec { }; cargoDeps = rustPlatform.fetchCargoTarball { - inherit src sourceRoot patches; + inherit src patches; name = "${pname}-${version}"; hash = "sha256-//TmozgWy9zrSpMKX92XdHj4fw/T1Elfgn4YhhR7ot0="; }; patches = [ ./Cargo.lock.patch ]; - inherit buildAndTestSubdir format nativeBuildInputs sourceRoot; + inherit buildAndTestSubdir format nativeBuildInputs preConfigure; pythonImportsCheck = [ "word_count" ];