From 0aa752df930b8396275ea9b9e7e512e2d8770531 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sun, 28 Jul 2024 20:14:31 +0200 Subject: [PATCH] python312Packages.premailer: drop nose dependency --- .../python-modules/premailer/default.nix | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/premailer/default.nix b/pkgs/development/python-modules/premailer/default.nix index dd6eec493338a..2435b36a86a69 100644 --- a/pkgs/development/python-modules/premailer/default.nix +++ b/pkgs/development/python-modules/premailer/default.nix @@ -1,33 +1,40 @@ { lib, buildPythonPackage, - fetchPypi, - isPy27, + fetchpatch2, + fetchFromGitHub, + setuptools, cssselect, cssutils, lxml, - mock, - nose, requests, cachetools, + pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage { pname = "premailer"; version = "3.10.0"; - format = "setuptools"; - disabled = isPy27; # no longer compatible with urllib + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "d1875a8411f5dc92b53ef9f193db6c0f879dc378d618e0ad292723e388bfe4c2"; + src = fetchFromGitHub { + owner = "peterbe"; + repo = "premailer"; + rev = "f4ded0b9701c4985e7ff5c5beda83324c264ea62"; # no tags + hash = "sha256-8ALdpR3aIDg0wP+JYCPY1f7mEJgdJm8xlLlgGpa0Sa4="; }; - buildInputs = [ - mock - nose + patches = [ + # Migrate to pytest: https://github.com/peterbe/premailer/pull/288 + (fetchpatch2 { + url = "https://github.com/peterbe/premailer/commit/afed2d515bbf3b99753abfae7435a44c352027e9.patch?full_index=1"; + hash = "sha256-aDProDHowThMBcVCRwXqcG17osHAeznDk4DFJ5Bv8kw="; + }) ]; - propagatedBuildInputs = [ + + build-system = [ setuptools ]; + + dependencies = [ cachetools cssselect cssutils @@ -35,6 +42,14 @@ buildPythonPackage rec { requests ]; + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportCheck = [ + "premailer" + "premailer.cache" + "premailer.merge_style" + ]; + meta = { description = "Turns CSS blocks into style attributes"; homepage = "https://github.com/peterbe/premailer";