diff --git a/pkgs/development/python-modules/django-modelsearch/default.nix b/pkgs/development/python-modules/django-modelsearch/default.nix new file mode 100644 index 000000000000..73fd60e8d7be --- /dev/null +++ b/pkgs/development/python-modules/django-modelsearch/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + django, + django-tasks, + + # tests + pytest-django, + pytestCheckHook, + django-modelcluster, +}: + +buildPythonPackage rec { + pname = "modelsearch"; + version = "1.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "wagtail"; + repo = "django-modelsearch"; + tag = "v${version}"; + hash = "sha256-tjwVepI9mdrMbTtxfe6yNUrSHWKndGxv2lJ8AfyNcr0="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + django + django-modelcluster + django-tasks + ]; + + pythonImportsCheck = [ "modelsearch" ]; + + # django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. + # You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. + doCheck = false; + + meta = { + description = "Index Django Models with Elasticsearch or OpenSearch and query them with the ORM"; + homepage = "https://github.com/wagtail/django-modelsearch"; + changelog = "https://github.com/wagtail/django-modelsearch/releases/tag/${src.tag}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb82560f6b42..87861798cafb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4083,6 +4083,8 @@ self: super: with self; { django-modelcluster = callPackage ../development/python-modules/django-modelcluster { }; + django-modelsearch = callPackage ../development/python-modules/django-modelsearch { }; + django-modeltranslation = callPackage ../development/python-modules/django-modeltranslation { }; django-mptt = callPackage ../development/python-modules/django-mptt { };