From 7d288b00ad501dfbfa0e37f17b3c29a50377173b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 30 May 2026 12:37:07 +0200 Subject: [PATCH] python3Packages.psautohint: fix build Prunes dependencies, migrates to finalAttrs and a PEP517 build. --- .../python-modules/psautohint/default.nix | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/psautohint/default.nix b/pkgs/development/python-modules/psautohint/default.nix index ae962b95e978..3a00ad840176 100644 --- a/pkgs/development/python-modules/psautohint/default.nix +++ b/pkgs/development/python-modules/psautohint/default.nix @@ -2,10 +2,9 @@ lib, buildPythonPackage, fetchFromGitHub, - fonttools, - lxml, - fs, # for fonttools extras + setuptools, setuptools-scm, + fonttools, pytestCheckHook, pytest-cov-stub, pytest-xdist, @@ -13,31 +12,32 @@ psautohint, # for passthru.tests }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "psautohint"; version = "2.4.0"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "adobe-type-tools"; repo = "psautohint"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; sha256 = "125nx7accvbk626qlfar90va1995kp9qfrz6a978q4kv2kk37xai"; fetchSubmodules = true; # data dir for tests }; postPatch = '' - echo '#define PSAUTOHINT_VERSION "${version}"' > libpsautohint/src/version.h + echo '#define PSAUTOHINT_VERSION "${finalAttrs.version}"' > libpsautohint/src/version.h sed -i '/use_scm_version/,+3d' setup.py - sed -i '/setup(/a \ version="${version}",' setup.py + sed -i '/setup(/a \ version="${finalAttrs.version}",' setup.py ''; - nativeBuildInputs = [ setuptools-scm ]; + build-system = [ + setuptools + setuptools-scm + ]; - propagatedBuildInputs = [ + dependencies = [ fonttools - lxml - fs ]; nativeCheckInputs = [ @@ -45,6 +45,7 @@ buildPythonPackage rec { pytest-cov-stub pytest-xdist ]; + disabledTests = lib.optionals (!runAllTests) [ # Slow tests, reduces test time from ~5 mins to ~30s "test_mmufo" @@ -69,4 +70,4 @@ buildPythonPackage rec { license = lib.licenses.bsd3; maintainers = [ lib.maintainers.sternenseemann ]; }; -} +})