python312Packages.mrsqm: fix build (#362775)

This commit is contained in:
Aleksana 2024-12-12 21:26:49 +08:00 committed by GitHub
commit 8627d7ada9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,47 +1,73 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
pythonOlder,
cython,
fftw,
pandas,
scikit-learn,
numpy,
pip,
setuptools,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "mrsqm";
version = "0.0.7";
format = "setuptools";
pyproject = true;
build-system = [
setuptools
];
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-kZwgRazvPCmARcfhLByh1E8VPurrb8gVZc96hFfDOvs=";
src = fetchFromGitHub {
owner = "mlgig";
repo = "mrsqm";
tag = "v.${version}";
hash = "sha256-5K6vCU0HExnmYNThZNDCbEtII9bUGauxDtKkJXe/85Q=";
};
buildInputs = [ fftw ];
nativeBuildInputs = [ cython ];
propagatedBuildInputs = [
dependencies = [
pandas
scikit-learn
numpy
pip
];
# Package has no tests
doCheck = false;
postPatch = ''
substituteInPlace setup.py \
--replace-fail "'pytest-runner'" ""
substituteInPlace pyproject.toml \
--replace-fail "numpy==" "numpy>="
'';
preBuild = ''
export HOME=$(mktemp -d)
'';
nativeCheckInputs = [
pytestCheckHook
];
pytestFlagsArray = [
"tests/mrsqm"
];
pythonImportsCheck = [ "mrsqm" ];
meta = with lib; {
meta = {
description = "MrSQM (Multiple Representations Sequence Miner) is a time series classifier";
homepage = "https://pypi.org/project/mrsqm";
changelog = "https://github.com/mlgig/mrsqm/releases/tag/v.${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ mbalatsko ];
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ mbalatsko ];
};
}