From 7073019f13bcd96baafa4c65fe8f88b0e9855550 Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Sun, 11 Aug 2024 16:43:46 +0900 Subject: [PATCH 1/2] python312Packages.python-fx: 0.3.1 -> 0.3.2, enable tests --- .../python-modules/python-fx/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/python-fx/default.nix b/pkgs/development/python-modules/python-fx/default.nix index b3a15ff913ca..88b743c8ab8f 100644 --- a/pkgs/development/python-modules/python-fx/default.nix +++ b/pkgs/development/python-modules/python-fx/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, antlr4-python3-runtime, asciimatics, buildPythonPackage, @@ -30,7 +31,7 @@ buildPythonPackage rec { pname = "python-fx"; - version = "0.3.1"; + version = "0.3.2"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -39,12 +40,13 @@ buildPythonPackage rec { owner = "cielong"; repo = "pyfx"; rev = "refs/tags/v${version}"; - hash = "sha256-BXKH3AlYMNbMREW5Qx72PrbuZdXlmVS+knWWu/y9PsA="; + hash = "sha256-Q5ihWnoa7nf4EkrY4SgrwjaNvTva4RdW9GRbnbsPXPc="; }; postPatch = '' - rm src/pyfx/model/common/jsonpath/*.{g4,interp,tokens} - antlr -Dlanguage=Python3 -visitor -o src/pyfx/model/common/jsonpath/ *.g4 + rm src/pyfx/model/common/jsonpath/*.py # upstream checks in generated files, remove to ensure they were regenerated + antlr -Dlanguage=Python3 -visitor src/pyfx/model/common/jsonpath/*.g4 + rm src/pyfx/model/common/jsonpath/*.{g4,interp,tokens} # no need to install ''; pythonRelaxDeps = true; @@ -81,13 +83,10 @@ buildPythonPackage rec { parameterized ]; - # antlr4 issue prevents us from running the tests - # https://github.com/antlr/antlr4/issues/4041 - doCheck = false; + # FAILED tests/test_event_loops.py::TwistedEventLoopTest::test_run - AssertionError: 'callback called with future outcome: True' not found in ['... + doCheck = !stdenv.isDarwin; - # pythonImportsCheck = [ - # "pyfx" - # ]; + pythonImportsCheck = [ "pyfx" ]; meta = with lib; { description = "Module to view JSON in a TUI"; From a7f9f9aad76b14ef3ad0323f6b357fabaf1791b1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 13 Aug 2024 09:45:32 +0200 Subject: [PATCH 2/2] python312Packages.python-fx: refactor --- .../python-modules/python-fx/default.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/python-fx/default.nix b/pkgs/development/python-modules/python-fx/default.nix index 88b743c8ab8f..0d906cd2e379 100644 --- a/pkgs/development/python-modules/python-fx/default.nix +++ b/pkgs/development/python-modules/python-fx/default.nix @@ -22,7 +22,6 @@ antlr4, pyyaml, setuptools, - six, urwid, parameterized, wcwidth, @@ -32,7 +31,7 @@ buildPythonPackage rec { pname = "python-fx"; version = "0.3.2"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -51,10 +50,9 @@ buildPythonPackage rec { pythonRelaxDeps = true; - nativeBuildInputs = [ - antlr4 - setuptools - ]; + build-system = [ setuptools ]; + + nativeBuildInputs = [ antlr4 ]; propagatedBuildInputs = [ antlr4-python3-runtime @@ -72,7 +70,6 @@ buildPythonPackage rec { pyfiglet pyperclip pyyaml - six urwid wcwidth yamale @@ -90,10 +87,10 @@ buildPythonPackage rec { meta = with lib; { description = "Module to view JSON in a TUI"; - mainProgram = "pyfx"; homepage = "https://github.com/cielong/pyfx"; changelog = "https://github.com/cielong/pyfx/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; + mainProgram = "pyfx"; }; }