From d9437bf4aae02561f783417cf0ae3298d07a7cae Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 24 Jun 2024 20:51:48 +0000 Subject: [PATCH] listparser: switch from `buildPythonPackage` -> `stdenv.mkDerivation` --- pkgs/python-packages/listparser/default.nix | 71 ++++++++++++--------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/pkgs/python-packages/listparser/default.nix b/pkgs/python-packages/listparser/default.nix index 78ccda984..2f5a4d965 100644 --- a/pkgs/python-packages/listparser/default.nix +++ b/pkgs/python-packages/listparser/default.nix @@ -1,49 +1,58 @@ { - buildPythonPackage, fetchFromGitHub, lib, lxml, nix-update-script, poetry-core, - python3, + pypaBuildHook, + pypaInstallHook, pytestCheckHook, requests, + stdenv, + toPythonModule, }: -buildPythonPackage rec { - pname = "listparser"; - version = "0.20"; +toPythonModule ( + stdenv.mkDerivation (finalAttrs: { + pname = "listparser"; + version = "0.20"; - format = "pyproject"; + src = fetchFromGitHub { + owner = "kurtmckee"; + repo = "listparser"; + rev = "v${finalAttrs.version}"; + hash = "sha256-eg9TrjDgvHsYt/0JQ7MK/uGc3KK3uGr3jRxzG0FlySg="; + }; - src = fetchFromGitHub { - owner = "kurtmckee"; - repo = "listparser"; - rev = "v${version}"; - hash = "sha256-eg9TrjDgvHsYt/0JQ7MK/uGc3KK3uGr3jRxzG0FlySg="; - }; + nativeBuildInputs = [ + poetry-core + pypaBuildHook + pypaInstallHook + ]; - nativeBuildInputs = [ - poetry-core - ]; + propagatedBuildInputs = [ + requests + lxml + ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ + pytestCheckHook + ]; - propagatedBuildInputs = [ - requests - lxml - ]; + pythonImportsCheck = [ + "listparser" + ]; - passthru.updateScript = nix-update-script { }; + doCheck = true; - meta = with lib; { - description = "Parse OPML subscription lists in Python"; - homepage = "https://github.com/kurtmckee/listparser"; - license = licenses.lgpl3Plus; - maintainers = [ maintainers.colinsane ]; - platforms = platforms.linux; - }; -} + passthru.updateScript = nix-update-script { }; + meta = with lib; { + description = "Parse OPML subscription lists in Python"; + homepage = "https://github.com/kurtmckee/listparser"; + license = licenses.lgpl3Plus; + maintainers = [ maintainers.colinsane ]; + platforms = platforms.linux; + }; + }) +)