From 88a78211ca1497080c2c2597d6d04b589431cdb3 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Sun, 25 May 2025 09:40:48 -0700 Subject: [PATCH] python3Packages.kinparse: unstable-2019-12-18 -> 1.2.3 --- .../python-modules/kinparse/default.nix | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/kinparse/default.nix b/pkgs/development/python-modules/kinparse/default.nix index 8ddde08f68d8..7dc864b5b834 100644 --- a/pkgs/development/python-modules/kinparse/default.nix +++ b/pkgs/development/python-modules/kinparse/default.nix @@ -2,37 +2,49 @@ lib, buildPythonPackage, fetchFromGitHub, - pytest, - future, pyparsing, + pytestCheckHook, + setuptools, }: -buildPythonPackage { +buildPythonPackage rec { pname = "kinparse"; - version = "unstable-2019-12-18"; - format = "setuptools"; + version = "1.2.3"; + pyproject = true; src = fetchFromGitHub { owner = "xesscorp"; repo = "kinparse"; - rev = "eeb3f346d57a67a471bdf111f39bef8932644481"; - sha256 = "1nrjnybwzy93c79yylcwmb4lvkx7hixavnjwffslz0zwn32l0kx3"; + tag = version; + hash = "sha256-170e2uhqpk6u/hahivWYubr3Ptb8ijymJSxhxrAfuyI="; }; + # Remove python2 build support as it breaks python >= 3.13 + postPatch = '' + substituteInPlace setup.cfg \ + --replace-fail "universal = 1" "universal = 0" + ''; + + build-system = [ setuptools ]; + + dependencies = [ pyparsing ]; + + pythonRemoveDeps = [ "future" ]; + + preCheck = '' + substituteInPlace tests/test_kinparse.py \ + --replace-fail "data/" "$src/tests/data/" + ''; + + nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ "kinparse" ]; - nativeCheckInputs = [ pytest ]; - - propagatedBuildInputs = [ - future - pyparsing - ]; - - meta = with lib; { + meta = { description = "Parser for KiCad EESCHEMA netlists"; mainProgram = "kinparse"; homepage = "https://github.com/xesscorp/kinparse"; - license = licenses.mit; - maintainers = with maintainers; [ matthuszagh ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ matthuszagh ]; }; }