python312Packages.annoy: migrate to pytest

This commit is contained in:
Martin Weinelt 2024-07-08 23:58:53 +02:00
parent 0cf8b76db9
commit ac1eeed1eb
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,10 +1,10 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
h5py,
numpy,
pynose,
pytestCheckHook,
pythonOlder,
setuptools,
}:
@ -16,9 +16,11 @@ buildPythonPackage rec {
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-nL/r7+Cl+EPropxr5MhNYB9PQa1N7QSG8biMOwdznBU=";
src = fetchFromGitHub {
owner = "spotify";
repo = "annoy";
rev = "refs/tags/v${version}";
hash = "sha256-oJHW4lULRun2in35pBGOKg44s5kgLH2BKiMOzVu4rf4=";
};
postPatch = ''
@ -32,7 +34,16 @@ buildPythonPackage rec {
nativeCheckInputs = [
numpy
pynose
pytestCheckHook
];
preCheck = ''
rm -rf annoy
'';
disabledTestPaths = [
# network access
"test/accuracy_test.py"
];
pythonImportsCheck = [ "annoy" ];