From 965933e299dec869793242a5eaed706ed36d1bc9 Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Sat, 28 Jun 2025 21:53:25 +0200 Subject: [PATCH 1/2] ical2orgpy: modernize --- pkgs/by-name/ic/ical2orgpy/package.nix | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ic/ical2orgpy/package.nix b/pkgs/by-name/ic/ical2orgpy/package.nix index 0ca92ac24413..1c9a10598917 100644 --- a/pkgs/by-name/ic/ical2orgpy/package.nix +++ b/pkgs/by-name/ic/ical2orgpy/package.nix @@ -1,23 +1,25 @@ { lib, - python3, + python3Packages, fetchFromGitHub, + versionCheckHook, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "ical2orgpy"; version = "0.5"; - - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "ical2org-py"; repo = "ical2org.py"; - rev = version; + tag = version; hash = "sha256-vBi1WYXMuDFS/PnwFQ/fqN5+gIvtylXidfZklyd6LcI="; }; - propagatedBuildInputs = with python3.pkgs; [ + build-system = [ python3Packages.setuptools ]; + + dependencies = with python3Packages; [ click future icalendar @@ -26,18 +28,21 @@ python3.pkgs.buildPythonApplication rec { recurring-ical-events ]; - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = with python3Packages; [ freezegun pytestCheckHook pyyaml + versionCheckHook ]; - meta = with lib; { - changelog = "https://github.com/ical2org-py/ical2org.py/blob/${src.rev}/CHANGELOG.rst"; + pythonImportsCheck = [ "ical2orgpy" ]; + + meta = { + changelog = "https://github.com/ical2org-py/ical2org.py/blob/${src.tag}/CHANGELOG.rst"; description = "Converting ICAL file into org-mode format"; homepage = "https://github.com/ical2org-py/ical2org.py"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ StillerHarpo ]; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ StillerHarpo ]; mainProgram = "ical2orgpy"; }; From 314d8b7d65b83379a8c79565167243ec6bfcc9ef Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Sat, 28 Jun 2025 21:58:59 +0200 Subject: [PATCH 2/2] ical2orgpy: fix build --- pkgs/by-name/ic/ical2orgpy/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ic/ical2orgpy/package.nix b/pkgs/by-name/ic/ical2orgpy/package.nix index 1c9a10598917..ac16557769bf 100644 --- a/pkgs/by-name/ic/ical2orgpy/package.nix +++ b/pkgs/by-name/ic/ical2orgpy/package.nix @@ -21,13 +21,14 @@ python3Packages.buildPythonApplication rec { dependencies = with python3Packages; [ click - future icalendar pytz tzlocal recurring-ical-events ]; + pythonRemoveDeps = [ "future" ]; + nativeCheckInputs = with python3Packages; [ freezegun pytestCheckHook