From 0d67a0d2f63f74b989e2347b1f3ef9130d9e2409 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 16 Apr 2024 13:33:42 +0200 Subject: [PATCH] python312Packages.ed25519: refactor - add pythonImportsCheck - add changelog to meta - remove vendorized versioneer.py --- .../python-modules/ed25519/default.nix | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ed25519/default.nix b/pkgs/development/python-modules/ed25519/default.nix index 1e59c7a16361..80e405313cbc 100644 --- a/pkgs/development/python-modules/ed25519/default.nix +++ b/pkgs/development/python-modules/ed25519/default.nix @@ -1,27 +1,45 @@ { lib, - fetchPypi, buildPythonPackage, - pythonAtLeast, + fetchFromGitHub, + fetchpatch, + pythonOlder, + setuptools, + versioneer, }: buildPythonPackage rec { pname = "ed25519"; version = "1.5"; - format = "setuptools"; + pyproject = true; - # last commit in 2019, various compat issues with 3.12 - disabled = pythonAtLeast "3.12"; + disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - sha256 = "0n1k83ww0pr4q6z0h7p8hvy21hcgb96jvgllfbwhvvyf37h3w182"; + src = fetchFromGitHub { + owner = "warner"; + repo = "python-ed25519"; + rev = "refs/tags/${version}"; + hash = "sha256-AwnhB5UGycQliNndbqd0JlI4vKSehCSy0qHv2EiB+jA="; }; + postPatch = '' + rm versioneer.py + ''; + + build-system = [ + setuptools + versioneer + ]; + + pythonImportsCheck = [ + "ed25519" + ]; + meta = with lib; { description = "Ed25519 public-key signatures"; mainProgram = "edsig"; homepage = "https://github.com/warner/python-ed25519"; + changelog = "https://github.com/warner/python-ed25519/blob/${version}/NEWS"; license = licenses.mit; maintainers = with maintainers; [ np ]; };