depot/third_party/nixpkgs/pkgs/development/python-modules/django-haystack/default.nix
Default email c7f94ff3ce Project import generated by Copybara.
GitOrigin-RevId: b85ed9dcbf187b909ef7964774f8847d554fab3b
2023-08-22 22:05:09 +02:00

79 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
# build dependencies
, setuptools
, setuptools-scm
# dependencies
, django
# tests
, elasticsearch
, geopy
, nose
, pysolr
, python-dateutil
, requests
, whoosh
}:
buildPythonPackage rec {
pname = "django-haystack";
version = "3.2.1";
format = "pyproject";
disabled = pythonOlder "3.5";
src = fetchPypi {
inherit pname version;
hash = "sha256-l+MZeu/CJf5AW28XYAolNL+CfLTWdDEwwgvBoG9yk6Q=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "geopy==" "geopy>="
'';
nativeBuildInputs = [
setuptools
setuptools-scm
];
buildInputs = [
django
];
passthru.optional-dependencies = {
elasticsearch = [
elasticsearch
];
};
doCheck = lib.versionOlder django.version "4";
nativeCheckInputs = [
geopy
nose
pysolr
python-dateutil
requests
whoosh
]
++ passthru.optional-dependencies.elasticsearch;
checkPhase = ''
runHook preCheck
python test_haystack/run_tests.py
runHook postCheck
'';
meta = with lib; {
description = "Pluggable search for Django";
homepage = "http://haystacksearch.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}