2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
|
|
|
|
# build dependencies
|
2023-08-22 20:05:09 +00:00
|
|
|
, setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
, setuptools-scm
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, django
|
|
|
|
|
|
|
|
# tests
|
2023-08-22 20:05:09 +00:00
|
|
|
, elasticsearch
|
2021-12-06 16:07:01 +00:00
|
|
|
, geopy
|
|
|
|
, nose
|
|
|
|
, pysolr
|
|
|
|
, python-dateutil
|
|
|
|
, requests
|
|
|
|
, whoosh
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-haystack";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.2.1";
|
2023-08-22 20:05:09 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-l+MZeu/CJf5AW28XYAolNL+CfLTWdDEwwgvBoG9yk6Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "geopy==" "geopy>="
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
django
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
elasticsearch = [
|
|
|
|
elasticsearch
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = lib.versionOlder django.version "4";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
geopy
|
|
|
|
nose
|
|
|
|
pysolr
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
whoosh
|
2023-08-22 20:05:09 +00:00
|
|
|
]
|
|
|
|
++ passthru.optional-dependencies.elasticsearch;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
python test_haystack/run_tests.py
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Pluggable search for Django";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://haystacksearch.org/";
|
|
|
|
license = licenses.bsd3;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|