From 7b791ffa8fc422258060972cd091f1cf6fcb39b9 Mon Sep 17 00:00:00 2001 From: kurogeek Date: Thu, 8 Jan 2026 15:27:36 +0700 Subject: [PATCH] python3Packages.django-stdimage: init at 6.0.2 --- .../django-stdimage/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 5 ++ 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/django-stdimage/default.nix diff --git a/pkgs/development/python-modules/django-stdimage/default.nix b/pkgs/development/python-modules/django-stdimage/default.nix new file mode 100644 index 000000000000..b3fed998628d --- /dev/null +++ b/pkgs/development/python-modules/django-stdimage/default.nix @@ -0,0 +1,63 @@ +{ + buildPythonPackage, + django, + fetchFromGitHub, + lib, + pytest-django, + pytestCheckHook, + setuptools-scm, + pillow, + pytest-cov, + gettext, + pythonOlder, + pythonAtLeast, +}: +buildPythonPackage rec { + pname = "django-stdimage"; + version = "6.0.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "codingjoe"; + repo = "django-stdimage"; + tag = version; + hash = "sha256-uwVU3Huc5fitAweShJjcMW//GBeIpJcxqKKLGo/EdIs="; + }; + + disabled = pythonOlder "3.8" || pythonAtLeast "3.13"; + + dependencies = [ + django + pillow + ]; + + build-system = [ setuptools-scm ]; + nativeBuildInputs = [ gettext ]; + + doCheck = true; + preCheck = '' + export DJANGO_SETTINGS_MODULE=tests.settings + ''; + disabledTests = [ + # SuspiciousFileOperation: Detected path traversal attempt (Even appear in upstream) + "test_variations_override" + ]; + pythonImportsCheck = [ + "stdimage" + "stdimage.validators" + "stdimage.models" + ]; + nativeCheckInputs = [ + pytest-django + pytest-cov + pytestCheckHook + ]; + + meta = with lib; { + description = "Django Standardized Image Field"; + homepage = "https://github.com/codingjoe/django-stdimage"; + changelog = "https://github.com/codingjoe/django-stdimage/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ kurogeek ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 91c430760cf5..fbafd297c7cb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4384,6 +4384,11 @@ self: super: with self; { django-statici18n = callPackage ../development/python-modules/django-statici18n { }; + django-stdimage = callPackage ../development/python-modules/django-stdimage { + django = django_4; + pytest-django = pytest-django.override { django = django_4; }; + }; + django-storages = callPackage ../development/python-modules/django-storages { }; django-stubs = callPackage ../development/python-modules/django-stubs { };