python3Packages.mir-eval: fix build, enable tests, refactor & clean

This commit is contained in:
Martin Weinelt
2025-06-09 23:27:29 +02:00
parent 8e7e639670
commit 58cb4eefc3
@@ -1,33 +1,53 @@
{
lib,
buildPythonPackage,
fetchPypi,
future,
six,
fetchFromGitHub,
setuptools,
decorator,
numpy,
scipy,
matplotlib,
pytestCheckHook,
pytest-cov-stub,
pytest-mpl,
}:
buildPythonPackage rec {
pname = "mir-eval";
version = "0.8.2";
format = "setuptools";
pyproject = true;
src = fetchPypi {
pname = "mir_eval";
inherit version;
hash = "sha256-FBo+EZMnaIn8MukRVH5z3LPoKe6M/qYPe7zWM8B5JWk=";
src = fetchFromGitHub {
owner = "mir-evaluation";
repo = "mir_eval";
tag = version;
hash = "sha256-Dq/kqoTY8YGATsr6MSgfQxkWvFpmH/Pf1pKBLPApylY=";
};
propagatedBuildInputs = [
future
six
build-system = [ setuptools ];
dependencies = [
decorator
numpy
scipy
matplotlib
];
optional-dependencies.display = [ matplotlib ];
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pytest-mpl
] ++ lib.flatten (lib.attrValues optional-dependencies);
preCheck = ''
pushd tests
'';
postCheck = ''
popd
'';
pythonImportsCheck = [ "mir_eval" ];
meta = with lib; {