Change:
python-fx fails at runtime, while doing its initial imports. Steps to reproduce the behavior: (hash is of as-of-writing nixpkgs-unstable) pyfx tui opens. Doesn't happen when e.g. installing current python-fx with pip on arch linux. (I considered packaging instead, but only found more breakage there. Anyway, I wouldn't be terribly sad if the answer to this is "Package abandonned, will be removed".) Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
I have not used the TUI as so far only served as dependency for . Looks like
I poked around and I don't think that's the same issue at all. (It's the same cause, an old generated file is lying around, but it's a different old generated file.) The prePatch is pretty fishy, it first removes the antlr-related files and then invokes antlr. Fixing that runs into a few type errors, which can be fixed: Now you'd think those type errors are due to the new antler version, but that's only partially true? Downgrading still requires some patching. If I have time I'll submit a PR fixing this, but just patching out the type checks from the feels wrong, so I might consult with upstream first.

Discussion:
{ lib, <ins> stdenv, </ins> antlr4-python3-runtime, asciimatics, buildPythonPackage,

antlr4, pyyaml, setuptools, <del> six, </del> urwid, parameterized, wcwidth,

buildPythonPackage rec { pname = "python-fx"; <del> version = "0.3.1"; format = "setuptools"; </del> <ins> version = "0.3.2"; pyproject = true; </ins> disabled = pythonOlder "3.8";

owner = "cielong"; repo = "pyfx"; rev = "refs/tags/v${version}"; <del> hash = "sha256-BXKH3AlYMNbMREW5Qx72PrbuZdXlmVS+knWWu/y9PsA="; </del> <ins> hash = "sha256-Q5ihWnoa7nf4EkrY4SgrwjaNvTva4RdW9GRbnbsPXPc="; </ins> }; postPatch = '' <del> rm src/pyfx/model/common/jsonpath/*.{g4,interp,tokens} antlr -Dlanguage=Python3 -visitor -o src/pyfx/model/common/jsonpath/ *.g4 </del> <ins> 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 </ins> ''; pythonRelaxDeps = true; <del> nativeBuildInputs = [ antlr4 setuptools ]; </del> <ins> build-system = [ setuptools ]; nativeBuildInputs = [ antlr4 ]; </ins> propagatedBuildInputs = [ antlr4-python3-runtime

pyfiglet pyperclip pyyaml <del> six </del> urwid wcwidth yamale

parameterized ]; <del> # antlr4 issue prevents us from running the tests # https://github.com/antlr/antlr4/issues/4041 doCheck = false; </del> <ins> # FAILED tests/test_event_loops.py::TwistedEventLoopTest::test_run - AssertionError: 'callback called with future outcome: True' not found in ['... doCheck = !stdenv.isDarwin; </ins> <del> # pythonImportsCheck = [ #   "pyfx" # ]; </del> <ins> pythonImportsCheck = [ "pyfx" ]; </ins> meta = with lib; { description = "Module to view JSON in a TUI"; <del> mainProgram = "pyfx"; </del> homepage = "https://github.com/cielong/pyfx"; changelog = "https://github.com/cielong/pyfx/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; <ins> mainProgram = "pyfx"; </ins> }; }