From dfe9e8f3379665b49617fa0737cf679bbd46c361 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Mon, 24 Nov 2025 00:18:54 +0000 Subject: [PATCH] dfmt: migrate to pyproject build The package now uses pyproject format instead of setuptools, with poetry-core as the build system. The build configuration has been updated to replace the deprecated poetry.masonry.api backend with poetry.core.masonry.api. dfmt: add tests to dfmt dfmt: Use poetry-core --- pkgs/by-name/df/dfmt/package.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/df/dfmt/package.nix b/pkgs/by-name/df/dfmt/package.nix index fc12e574dd4a..3265102e8b76 100644 --- a/pkgs/by-name/df/dfmt/package.nix +++ b/pkgs/by-name/df/dfmt/package.nix @@ -1,25 +1,29 @@ { lib, - python3, + python3Packages, fetchPypi, }: -let - inherit (python3.pkgs) - buildPythonApplication - pythonOlder - ; -in -buildPythonApplication rec { +python3Packages.buildPythonApplication (finalAttrs: { pname = "dfmt"; version = "1.2.0"; - format = "setuptools"; + pyproject = true; + + build-system = [ + python3Packages.poetry-core + ]; src = fetchPypi { - inherit pname version; - sha256 = "7af6360ca8d556f1cfe82b97f03b8d1ea5a9d6de1fa3018290c844b6566d9d6e"; + inherit (finalAttrs) pname version; + hash = "sha256-evY2DKjVVvHP6CuX8DuNHqWp1t4fowGCkMhEtlZtnW4="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api' \ + --replace-fail 'poetry>=' 'poetry-core>=' \ + ''; + meta = { description = "Format paragraphs, comments and doc strings"; mainProgram = "dfmt"; @@ -27,4 +31,4 @@ buildPythonApplication rec { license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ cole-h ]; }; -} +})