From 1e4a3ce6a663ea6d3a1ced84548a9636529f66b4 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Wed, 4 Jun 2025 12:15:35 -0700 Subject: [PATCH] python3Packages.parsedmarc: buildFromGitHub --- .../python-modules/parsedmarc/default.nix | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index cad17e4fb9cb..ea69c6e97119 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, fetchurl, # build-system @@ -35,6 +35,9 @@ requests, tqdm, xmltodict, + + # test + unittestCheckHook, }: let @@ -48,9 +51,11 @@ buildPythonPackage rec { version = "8.18.1"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-qE/WMovVlB9u0lyVl3HapHzvhG+fGTC+6DDBUKRU/2w="; + src = fetchFromGitHub { + owner = "domainaware"; + repo = "parsedmarc"; + tag = version; + hash = "sha256-PndhtbZgN4q23v8flPU7uKRsxnN9MR/JaaVfecwEA54="; }; build-system = [ @@ -91,9 +96,9 @@ buildPythonPackage rec { xmltodict ]; - # no tests on PyPI, no tags on GitHub - # https://github.com/domainaware/parsedmarc/issues/426 - doCheck = false; + nativeCheckInputs = [ + unittestCheckHook + ]; pythonImportsCheck = [ "parsedmarc" ]; @@ -105,9 +110,7 @@ buildPythonPackage rec { meta = { description = "Python module and CLI utility for parsing DMARC reports"; homepage = "https://domainaware.github.io/parsedmarc/"; - changelog = "https://github.com/domainaware/parsedmarc/blob/master/CHANGELOG.md#${ - lib.replaceStrings [ "." ] [ "" ] version - }"; + changelog = "https://github.com/domainaware/parsedmarc/blob/${src.tag}/CHANGELOG.md"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ talyz ]; mainProgram = "parsedmarc";