{ lib, buildPythonPackage, fetchFromGitHub, replaceVars, pythonOlder, hatch-vcs, hatchling, backports-zoneinfo, python-dateutil, tzdata, hypothesis, pytestCheckHook, }: buildPythonPackage rec { version = "6.0.1"; pname = "icalendar"; pyproject = true; src = fetchFromGitHub { owner = "collective"; repo = "icalendar"; rev = "refs/tags/v${version}"; hash = "sha256-pcTiXRiHtx7jVzxDkY6WDhzo8sg8fPecqTpRSRIdvfs="; }; patches = [ (replaceVars ./no-dynamic-version.patch { inherit version; }) ]; build-system = [ hatch-vcs hatchling ]; dependencies = [ python-dateutil tzdata ] ++ lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ]; nativeCheckInputs = [ hypothesis pytestCheckHook ]; pytestFlagsArray = [ "src/icalendar" ]; meta = with lib; { changelog = "https://github.com/collective/icalendar/blob/v${version}/CHANGES.rst"; description = "Parser/generator of iCalendar files"; mainProgram = "icalendar"; homepage = "https://github.com/collective/icalendar"; license = licenses.bsd2; maintainers = with maintainers; [ olcai ]; }; }