diff --git a/pkgs/applications/misc/khal/default.nix b/pkgs/applications/misc/khal/default.nix index 32c307af6025..b4151a9c5095 100644 --- a/pkgs/applications/misc/khal/default.nix +++ b/pkgs/applications/misc/khal/default.nix @@ -1,12 +1,35 @@ -{ lib -, stdenv -, fetchFromGitHub -, glibcLocales -, installShellFiles -, python3 +{ + lib, + stdenv, + fetchFromGitHub, + glibcLocales, + installShellFiles, + python3, }: -python3.pkgs.buildPythonApplication rec { +let + python = python3.override { + packageOverrides = self: super: { + # https://github.com/pimutils/khal/issues/1361 + icalendar = super.icalendar.overridePythonAttrs (old: rec { + version = "5.0.13"; + src = fetchFromGitHub { + owner = "collective"; + repo = "icalendar"; + rev = "refs/tags/v${version}"; + hash = "sha256-2gpWfLXR4HThw23AWxY2rY9oiK6CF3Qiad8DWHCs4Qk="; + }; + patches = [ ]; + build-system = with self; [ setuptools ]; + dependencies = with self; [ + python-dateutil + pytz + ]; + }); + }; + }; +in +python.pkgs.buildPythonApplication rec { pname = "khal"; version = "0.11.3"; pyproject = true; @@ -18,16 +41,17 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-YP2kQ/qXPDwvFvlHf+A2Ymvk49dmt5tAnTaOhrOV92M="; }; + build-system = with python.pkgs; [ + setuptools + setuptools-scm + ]; + nativeBuildInputs = [ glibcLocales installShellFiles - ] ++ (with python3.pkgs; [ - setuptools-scm - sphinx - sphinxcontrib-newsfeed - ]); + ]; - propagatedBuildInputs = with python3.pkgs;[ + dependencies = with python.pkgs; [ atomicwrites click click-log @@ -45,7 +69,7 @@ python3.pkgs.buildPythonApplication rec { urwid ]; - nativeCheckInputs = with python3.pkgs;[ + nativeCheckInputs = with python.pkgs; [ freezegun hypothesis packaging @@ -61,8 +85,15 @@ python3.pkgs.buildPythonApplication rec { --fish <(_KHAL_COMPLETE=fish_source $out/bin/khal) # man page - PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib-newsfeed ])}/bin:$PATH" \ - make -C doc man + PATH="${ + python3.withPackages ( + ps: with ps; [ + sphinx + sphinxcontrib-newsfeed + ] + ) + }/bin:$PATH" \ + make -C doc man installManPage doc/build/man/khal.1 # .desktop file @@ -71,7 +102,7 @@ python3.pkgs.buildPythonApplication rec { doCheck = !stdenv.hostPlatform.isAarch64; - LC_ALL = "en_US.UTF-8"; + env.LC_ALL = "en_US.UTF-8"; disabledTests = [ # timing based diff --git a/pkgs/applications/office/todoman/default.nix b/pkgs/applications/office/todoman/default.nix index eae9e424857f..75adb0425cc9 100644 --- a/pkgs/applications/office/todoman/default.nix +++ b/pkgs/applications/office/todoman/default.nix @@ -1,30 +1,32 @@ -{ lib -, fetchFromGitHub -, glibcLocales -, installShellFiles -, jq -, python3 +{ + fetchFromGitHub, + installShellFiles, + jq, + lib, + python3, }: python3.pkgs.buildPythonApplication rec { pname = "todoman"; version = "4.4.0"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "pimutils"; - repo = pname; + repo = "todoman"; rev = "refs/tags/v${version}"; hash = "sha256-5tQaNT6QVN9mxa9t6OvMux4ZGy4flUqszTAwet2QL0w="; }; nativeBuildInputs = [ installShellFiles - ] ++ (with python3.pkgs; [ - setuptools-scm - ]); + ]; - propagatedBuildInputs = with python3.pkgs; [ + build-system = with python3.pkgs; [ + setuptools-scm + ]; + + dependencies = with python3.pkgs; [ atomicwrites click click-log @@ -34,22 +36,18 @@ python3.pkgs.buildPythonApplication rec { parsedatetime python-dateutil pyxdg + pytz tabulate urwid ]; nativeCheckInputs = with python3.pkgs; [ - flake8 - flake8-import-order freezegun hypothesis pytestCheckHook - glibcLocales pytest-cov-stub ]; - LC_ALL = "en_US.UTF-8"; - postInstall = '' installShellCompletion --bash contrib/completion/bash/_todo substituteInPlace contrib/completion/zsh/_todo --replace "jq " "${lib.getExe jq} " @@ -87,9 +85,14 @@ python3.pkgs.buildPythonApplication rec { now. Unsupported fields may not be shown but are never deleted or altered. ''; - changelog = "https://todoman.readthedocs.io/en/stable/changelog.html#v${builtins.replaceStrings ["."] ["-"] version}"; + changelog = "https://todoman.readthedocs.io/en/stable/changelog.html#v${ + builtins.replaceStrings [ "." ] [ "-" ] version + }"; license = lib.licenses.isc; - maintainers = with lib.maintainers; [ leenaars antonmosich ]; + maintainers = with lib.maintainers; [ + leenaars + antonmosich + ]; mainProgram = "todo"; }; } diff --git a/pkgs/by-name/au/autosuspend/package.nix b/pkgs/by-name/au/autosuspend/package.nix index 479f6d69d736..16217b9f3fd6 100644 --- a/pkgs/by-name/au/autosuspend/package.nix +++ b/pkgs/by-name/au/autosuspend/package.nix @@ -6,7 +6,8 @@ python3.pkgs.buildPythonApplication rec { pname = "autosuspend"; - version = "7.0.1"; + version = "7.0.2"; + pyproject = true; disabled = python3.pythonOlder "3.10"; @@ -14,9 +15,13 @@ python3.pkgs.buildPythonApplication rec { owner = "languitar"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-Zjo8H5PU6JezrBF0XBHvmePUTNeX74BX4NsHtPozcKs="; + hash = "sha256-QmZX5I1D1iYUQ6Ll0tkbpjzqaOIBaGAltKHwUqLB6uk="; }; + build-system = with python3.pkgs; [ + setuptools + ]; + dependencies = with python3.pkgs; [ dbus-python icalendar diff --git a/pkgs/development/python-modules/icalendar/default.nix b/pkgs/development/python-modules/icalendar/default.nix index 1170485bf39f..fb88bcfebc84 100644 --- a/pkgs/development/python-modules/icalendar/default.nix +++ b/pkgs/development/python-modules/icalendar/default.nix @@ -2,17 +2,19 @@ lib, buildPythonPackage, fetchFromGitHub, + replaceVars, pythonOlder, - setuptools, + hatch-vcs, + hatchling, backports-zoneinfo, python-dateutil, - pytz, + tzdata, hypothesis, pytestCheckHook, }: buildPythonPackage rec { - version = "5.0.13"; + version = "6.0.1"; pname = "icalendar"; pyproject = true; @@ -20,14 +22,23 @@ buildPythonPackage rec { owner = "collective"; repo = "icalendar"; rev = "refs/tags/v${version}"; - hash = "sha256-2gpWfLXR4HThw23AWxY2rY9oiK6CF3Qiad8DWHCs4Qk="; + hash = "sha256-pcTiXRiHtx7jVzxDkY6WDhzo8sg8fPecqTpRSRIdvfs="; }; - build-system = [ setuptools ]; + patches = [ + (replaceVars ./no-dynamic-version.patch { + inherit version; + }) + ]; + + build-system = [ + hatch-vcs + hatchling + ]; dependencies = [ python-dateutil - pytz + tzdata ] ++ lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ]; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/icalendar/no-dynamic-version.patch b/pkgs/development/python-modules/icalendar/no-dynamic-version.patch new file mode 100644 index 000000000000..4754b6441a5f --- /dev/null +++ b/pkgs/development/python-modules/icalendar/no-dynamic-version.patch @@ -0,0 +1,17 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 9730e46..9834686 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -34,11 +34,7 @@ maintainers = [ + { name="Christian Geier" }, + { name="Jaca", email="vitouejj@gmail.com" }, + ] +-# These attributes are dynamically generated by hatch-vcs +-dynamic = [ +- "urls", +- "version" +-] ++version = "@version@" + description = "iCalendar parser/generator" + readme = { file = "README.rst", content-type = "text/x-rst" } + diff --git a/pkgs/development/python-modules/icalevents/default.nix b/pkgs/development/python-modules/icalevents/default.nix index 8c0839590676..b5303060948c 100644 --- a/pkgs/development/python-modules/icalevents/default.nix +++ b/pkgs/development/python-modules/icalevents/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch2, pythonOlder, pytestCheckHook, poetry-core, @@ -25,6 +26,14 @@ buildPythonPackage rec { hash = "sha256-Bp+Wz88q65Gem8LyRz0A4xE5hIgOD+iZ7E1UlnfFiD4="; }; + patches = [ + (fetchpatch2 { + name = "icalendar-v6-compat.patch"; + url = "https://github.com/jazzband/icalevents/commit/fa925430bd63e46b0941b84a1ae2c9a063f2f720.patch"; + hash = "sha256-MeRC3iJ5raKvl9udzv/44Vs34LxSzq1S6VVKAVFSpiY="; + }) + ]; + build-system = [ poetry-core ]; diff --git a/pkgs/development/python-modules/recurring-ical-events/default.nix b/pkgs/development/python-modules/recurring-ical-events/default.nix index 3be853d2fc5e..de3e2f377d88 100644 --- a/pkgs/development/python-modules/recurring-ical-events/default.nix +++ b/pkgs/development/python-modules/recurring-ical-events/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "recurring-ical-events"; - version = "3.3.0"; + version = "3.3.2"; disabled = pythonOlder "3.8"; @@ -26,7 +26,7 @@ buildPythonPackage rec { owner = "niccokunzmann"; repo = "python-recurring-ical-events"; rev = "v${version}"; - hash = "sha256-1Ggxi61epge6Rxc/vJ7OuuNjjeaQYReEPeOZV8DLghk="; + hash = "sha256-1cWjOaL+STrHMux/fc+FaRVQIOMcseznNRcghsV+DtM="; }; build-system = [ setuptools ]; @@ -47,12 +47,6 @@ buildPythonPackage rec { pygments ]; - disabledTests = lib.optionals (lib.versionOlder icalendar.version "6") [ - # ModuleNotFoundError: No module named 'icalendar.timezone' - "test_can_import_zoneinfo" - "test_documentation_file" - ]; - pythonImportsCheck = [ "recurring_ical_events" ]; meta = { diff --git a/pkgs/development/python-modules/x-wr-timezone/default.nix b/pkgs/development/python-modules/x-wr-timezone/default.nix index 4d873e9590f5..507180439589 100644 --- a/pkgs/development/python-modules/x-wr-timezone/default.nix +++ b/pkgs/development/python-modules/x-wr-timezone/default.nix @@ -4,46 +4,43 @@ fetchFromGitHub, setuptools, icalendar, - pytz, + tzdata, pytestCheckHook, restructuredtext-lint, pygments, + pytz, }: buildPythonPackage rec { pname = "x-wr-timezone"; - version = "0.0.7"; + version = "1.0.1"; pyproject = true; src = fetchFromGitHub { owner = "niccokunzmann"; repo = "x-wr-timezone"; rev = "v${version}"; - hash = "sha256-itqsVYYUcpbKTh0BM6IHk6F9xhB+pAQnnJsnZAVpNL4="; + hash = "sha256-MDFniFhgRuNtYITH/IUUP/HHC79coqxgXrlErj+Yrcs="; }; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ icalendar - pytz + tzdata ]; nativeCheckInputs = [ pytestCheckHook restructuredtext-lint pygments + pytz ]; preCheck = '' export PATH=$out/bin:$PATH ''; - disabledTests = [ - "test_input_to_output" - "test_output_stays_the_same" - ]; - pythonImportsCheck = [ "x_wr_timezone" ]; meta = { diff --git a/pkgs/servers/xandikos/default.nix b/pkgs/servers/xandikos/default.nix index c22db465b223..d86ff503e803 100644 --- a/pkgs/servers/xandikos/default.nix +++ b/pkgs/servers/xandikos/default.nix @@ -1,13 +1,15 @@ -{ lib -, fetchFromGitHub -, python3Packages -, nixosTests +{ + fetchFromGitHub, + fetchpatch2, + lib, + nixosTests, + python3Packages, }: python3Packages.buildPythonApplication rec { pname = "xandikos"; version = "0.2.11"; - format = "pyproject"; + pyproject = true; disabled = python3Packages.pythonOlder "3.9"; @@ -18,12 +20,20 @@ python3Packages.buildPythonApplication rec { hash = "sha256-cBsceJ6tib8OYx5L2Hv2AqRS+ADRSLIuJGIULNpAmEI="; }; - nativeBuildInputs = with python3Packages; [ - setuptools - wheel + patches = [ + (fetchpatch2 { + name = "fix-compatibility-with-icalendar-v6.patch"; + url = "https://github.com/jelmer/xandikos/commit/ae8924c374ed86b2efde5bfbc75e56f6d8318086.patch"; + excludes = [ "requirements.txt" ]; + hash = "sha256-PCKo5C6Ejw9ZsFFLAMw1ZtMoCq9gJxR65K7CM6RUYwU="; + }) ]; - propagatedBuildInputs = with python3Packages; [ + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ aiohttp aiohttp-openmetrics dulwich @@ -31,6 +41,7 @@ python3Packages.buildPythonApplication rec { icalendar jinja2 multidict + pytz vobject ];