python3.pkgs.linear_operator: use setuptools-scm to get version (#250240)

This commit is contained in:
Theodore Ni 2023-08-19 23:57:17 -07:00 committed by GitHub
parent f410499cb1
commit 5ff791b8fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"