From 5e40f9bfee56f2c7924a005a422a7b4924cb9ecf Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Mon, 7 Jul 2025 10:43:49 +0200 Subject: [PATCH 1/2] python3Packages.beziers: modernize --- .../development/python-modules/beziers/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/beziers/default.nix b/pkgs/development/python-modules/beziers/default.nix index e0fdaaca9c0a..929ba75ae225 100644 --- a/pkgs/development/python-modules/beziers/default.nix +++ b/pkgs/development/python-modules/beziers/default.nix @@ -5,6 +5,7 @@ dotmap, matplotlib, pyclipper, + setuptools, unittestCheckHook, gitUpdater, }: @@ -12,9 +13,8 @@ buildPythonPackage rec { pname = "beziers"; version = "0.6.0"; - format = "setuptools"; + pyproject = true; - # PyPI doesn't have a proper source tarball, fetch from Github instead src = fetchFromGitHub { owner = "simoncozens"; repo = "beziers.py"; @@ -22,7 +22,9 @@ buildPythonPackage rec { hash = "sha256-NjmWsRz/NPPwXPbiSaOeKJMrYmSyNTt5ikONyAljgvM="; }; - propagatedBuildInputs = [ pyclipper ]; + build-system = [ setuptools ]; + + dependencies = [ pyclipper ]; nativeCheckInputs = [ dotmap @@ -37,10 +39,10 @@ buildPythonPackage rec { passthru.updateScript = gitUpdater { rev-prefix = "v"; }; - meta = with lib; { + meta = { description = "Python library for manipulating Bezier curves and paths in fonts"; homepage = "https://github.com/simoncozens/beziers.py"; - license = licenses.mit; - maintainers = with maintainers; [ danc86 ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ danc86 ]; }; } From e855ed38ea9c0a479f9960ae482f8018389a95da Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Mon, 7 Jul 2025 10:44:38 +0200 Subject: [PATCH 2/2] python3Packages.beziers: fix darwin build --- .../python-modules/beziers/default.nix | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/beziers/default.nix b/pkgs/development/python-modules/beziers/default.nix index 929ba75ae225..3131f75ab469 100644 --- a/pkgs/development/python-modules/beziers/default.nix +++ b/pkgs/development/python-modules/beziers/default.nix @@ -1,12 +1,14 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, dotmap, matplotlib, pyclipper, + pytestCheckHook, + pythonImportsCheckHook, setuptools, - unittestCheckHook, gitUpdater, }: @@ -26,17 +28,25 @@ buildPythonPackage rec { dependencies = [ pyclipper ]; + preCheck = '' + # silence matplotlib warning + export MPLCONFIGDIR=$(mktemp -d) + ''; + nativeCheckInputs = [ dotmap matplotlib - unittestCheckHook + pytestCheckHook + pythonImportsCheckHook ]; - unittestFlagsArray = [ - "-s" - "test" - "-v" + + disabledTests = lib.optionals stdenv.isDarwin [ + # Fails on macOS with Trace/BPT trap: 5 - something to do with recursion depth + "test_cubic_cubic" ]; + pythonImportsCheckFlags = [ "beziers" ]; + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; meta = {