From 807f70aff6868dcf5220260b680931516bd4fe6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 19 Mar 2021 20:25:24 +0100 Subject: [PATCH 1/3] python3Packages.setuptools-rust: 0.11.6 -> 0.12.1 Changelog: https://github.com/PyO3/setuptools-rust/releases/tag/v0.12.1 https://github.com/PyO3/setuptools-rust/releases/tag/v0.12.0 --- .../python-modules/setuptools-rust/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/setuptools-rust/default.nix b/pkgs/development/python-modules/setuptools-rust/default.nix index e3d8a35186a..f7cc04c4eeb 100644 --- a/pkgs/development/python-modules/setuptools-rust/default.nix +++ b/pkgs/development/python-modules/setuptools-rust/default.nix @@ -2,7 +2,7 @@ , lib , buildPythonPackage , fetchPypi -, isPy27 +, pythonOlder , semantic-version , setuptools , setuptools-scm @@ -11,12 +11,12 @@ buildPythonPackage rec { pname = "setuptools-rust"; - version = "0.11.6"; - disabled = isPy27; + version = "0.12.1"; + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca"; + sha256 = "647009e924f0ae439c7f3e0141a184a69ad247ecb9044c511dabde232d3d570e"; }; nativeBuildInputs = [ setuptools-scm ]; From 313177129b521e49d2acc7ad884cf798e3a01b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 20 Mar 2021 08:38:14 +0100 Subject: [PATCH 2/3] python3Packages.setuptools-rust: fix passthru test The build wanted to create a Cargo.lock in the top-level source directory (presumably because it is also a Cargo project), since we were crating the lock file in sourceRoot (which was set to the example project). This failed because the sources are read-only. Change the test to create the lock file in the top-level crate directory, which is Cargo's default behavior. --- .../python-modules/setuptools-rust/pyo3-test/default.nix | 6 +++++- pkgs/development/tools/rust/maturin/pyo3-test/generic.nix | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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" ]; From cf66c08b8436c02b11ab4a4fb665fc4731abaee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 20 Mar 2021 08:50:28 +0100 Subject: [PATCH 3/3] python3Packages.setuptools-rust: do no mix Python versions in tests The passthru test used python3Packages, mixing different Python version when testing on a Python version different that the python3 alias. --- pkgs/development/tools/rust/maturin/pyo3-test/default.nix | 4 ++-- pkgs/development/tools/rust/maturin/pyo3-test/generic.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/rust/maturin/pyo3-test/default.nix b/pkgs/development/tools/rust/maturin/pyo3-test/default.nix index b118309b36d..7f79c8565d2 100644 --- a/pkgs/development/tools/rust/maturin/pyo3-test/default.nix +++ b/pkgs/development/tools/rust/maturin/pyo3-test/default.nix @@ -1,8 +1,8 @@ -{ callPackage +{ python3 , rustPlatform }: -callPackage ./generic.nix { +python3.pkgs.callPackage ./generic.nix { buildAndTestSubdir = "examples/word-count"; nativeBuildInputs = with rustPlatform; [ diff --git a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix index 84ca2ddf77f..41175ad8538 100644 --- a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix +++ b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix @@ -3,7 +3,7 @@ { lib , fetchFromGitHub -, python3Packages +, python , rustPlatform , nativeBuildInputs @@ -13,7 +13,7 @@ , preConfigure ? "" }: -python3Packages.buildPythonPackage rec { +python.pkgs.buildPythonPackage rec { pname = "word-count"; version = "0.13.2";