From 5c5a120b4e2c2b7a853c5ba6a98b184169d2d04f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 13 May 2025 03:12:36 +0200 Subject: [PATCH] python3Packages.django-cryptography: 1.1 -> 1.1-unstable-2024-02-16 Upstream author has apparently vanished, so this is probably it until a fork appears. --- .../django-cryptography/default.nix | 45 +++++++++++-------- .../django-cryptography/fix-setup-cfg.patch | 16 ------- 2 files changed, 26 insertions(+), 35 deletions(-) delete mode 100644 pkgs/development/python-modules/django-cryptography/fix-setup-cfg.patch diff --git a/pkgs/development/python-modules/django-cryptography/default.nix b/pkgs/development/python-modules/django-cryptography/default.nix index 7f4d2804c4dd..1d2c375e2749 100644 --- a/pkgs/development/python-modules/django-cryptography/default.nix +++ b/pkgs/development/python-modules/django-cryptography/default.nix @@ -5,45 +5,52 @@ django-appconf, fetchFromGitHub, lib, - python, - pythonOlder, + pytestCheckHook, + pytest-django, setuptools, }: -buildPythonPackage rec { +buildPythonPackage { pname = "django-cryptography"; - version = "1.1"; - disabled = pythonOlder "3.7"; - format = "pyproject"; + version = "1.1-unstable-2024-02-16"; + pyproject = true; src = fetchFromGitHub { owner = "georgemarshall"; repo = "django-cryptography"; - tag = version; - hash = "sha256-C3E2iT9JdLvF+1g+xhZ8dPDjjh25JUxLAtTMnalIxPk="; + rev = "a5cde9beed707a14a2ef2f1f7f1fee172feb8b5e"; + hash = "sha256-Xj/fw8EapsYvVbZPRQ81yeE9QpIQ1TIuk+ASOCGh/Uc="; }; - nativeBuildInputs = [ setuptools ]; + postPatch = '' + substituteInPlace setup.cfg \ + --replace-fail "packages = django_cryptography" "packages = find:" + ''; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ cryptography django django-appconf ]; - patches = [ - # See: https://github.com/georgemarshall/django-cryptography/pull/88 - ./fix-setup-cfg.patch - ]; - pythonImportsCheck = [ "django_cryptography" ]; - checkPhase = '' - runHook preCheck - ${python.interpreter} ./runtests.py - runHook postCheck + nativeCheckInputs = [ + pytest-django + pytestCheckHook + ]; + + preCheck = '' + export DJANGO_SETTINGS_MODULE=tests.settings ''; + disabledTests = [ + # self.assertEqual(len(errors), 1) - AssertionError: 0 != 1 + "test_field_checks" + ]; + meta = with lib; { homepage = "https://github.com/georgemarshall/django-cryptography"; description = "Set of primitives for performing cryptography in Django"; diff --git a/pkgs/development/python-modules/django-cryptography/fix-setup-cfg.patch b/pkgs/development/python-modules/django-cryptography/fix-setup-cfg.patch deleted file mode 100644 index 0cb7b9dba2aa..000000000000 --- a/pkgs/development/python-modules/django-cryptography/fix-setup-cfg.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -index 865b4c3..577d917 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -35,7 +35,10 @@ project_urls = - Documentation = https://django-cryptography.readthedocs.io - - [options] --packages = django_cryptography -+packages = -+ django_cryptography -+ django_cryptography.core -+ django_cryptography.utils - python_requires = >=3.6 - include_package_data = True - install_requires =