From 8e7947fa0604dedddc4a2d38837f3b4c47310b3f Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 4 Nov 2023 13:34:17 +0900 Subject: [PATCH] python311Packages.torrent-parser: refactor --- .../python-modules/torrent-parser/default.nix | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/torrent-parser/default.nix b/pkgs/development/python-modules/torrent-parser/default.nix index 42250d0348a1..2e946229747f 100644 --- a/pkgs/development/python-modules/torrent-parser/default.nix +++ b/pkgs/development/python-modules/torrent-parser/default.nix @@ -1,20 +1,38 @@ -{ buildPythonPackage, lib, fetchFromGitHub }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, pytestCheckHook +}: buildPythonPackage rec { pname = "torrent-parser"; version = "0.4.1"; + pyproject = true; - # No tarballs on Pypi src = fetchFromGitHub { owner = "7sDream"; repo = "torrent_parser"; rev = "v${version}"; - sha256 = "sha256-zM738r3o9dGZYoWLN7fM4E06m6YPcAODEkgDS6wU/Sc="; + hash = "sha256-zM738r3o9dGZYoWLN7fM4E06m6YPcAODEkgDS6wU/Sc="; }; + nativeBuildInputs = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "torrent_parser" + ]; + meta = { description = "A .torrent file parser and creator for both Python 2 and 3"; homepage = "https://github.com/7sDream/torrent_parser"; + changelog = "https://github.com/7sDream/torrent_parser/blob/${src.rev}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ ]; };