From 5ff791b8fd3fe4e5dbc4f50fcc39732ef7e6d328 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Sat, 19 Aug 2023 23:57:17 -0700 Subject: [PATCH] python3.pkgs.linear_operator: use setuptools-scm to get version (#250240) --- .../linear_operator/default.nix | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/linear_operator/default.nix b/pkgs/development/python-modules/linear_operator/default.nix index baecb5a732f6..f42522016c1f 100644 --- a/pkgs/development/python-modules/linear_operator/default.nix +++ b/pkgs/development/python-modules/linear_operator/default.nix @@ -2,9 +2,12 @@ , buildPythonPackage , fetchFromGitHub , jaxtyping -, scipy -, torch , pytestCheckHook +, scipy +, setuptools +, setuptools-scm +, torch +, wheel }: buildPythonPackage rec { @@ -19,10 +22,13 @@ buildPythonPackage rec { hash = "sha256-7NkcvVDwFaLHBZZhq7aKY3cWxe90qeKmodP6cVsdrPM="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace 'find_version("linear_operator", "version.py")' \"$version\" - ''; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools + setuptools-scm + wheel + ]; propagatedBuildInputs = [ jaxtyping @@ -30,10 +36,12 @@ buildPythonPackage rec { torch ]; - checkInputs = [ + pythonImportsCheck = [ "linear_operator" ]; + + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ "linear_operator" ]; + disabledTests = [ # flaky numerical tests "test_svd"