diff --git a/pkgs/by-name/ph/phart/package.nix b/pkgs/by-name/ph/phart/package.nix new file mode 100644 index 000000000000..a2ff7cd98cef --- /dev/null +++ b/pkgs/by-name/ph/phart/package.nix @@ -0,0 +1,3 @@ +{ python3Packages }: + +python3Packages.toPythonApplication python3Packages.phart diff --git a/pkgs/development/python-modules/phart/default.nix b/pkgs/development/python-modules/phart/default.nix new file mode 100644 index 000000000000..7f437fc3565b --- /dev/null +++ b/pkgs/development/python-modules/phart/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + hatchling, + networkx, + pytestCheckHook, + pytest-cov-stub, + pydot, +}: + +buildPythonPackage rec { + pname = "phart"; + version = "1.1.4"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-JpHjEVKpOPSNUdUjZxWBHt6AFCpci1nSRWhDXxG6nyw="; + }; + + pyproject = true; + + build-system = [ + hatchling + ]; + + preCheck = '' + export PATH=$out/bin:$PATH + ''; + + postPatch = '' + + # pythonRelaxDeps = true; didn't work + substituteInPlace pyproject.toml \ + --replace-fail 'hatchling==1.26.3' 'hatchling' + + # This line makes the cli tool not work, removing it fixes it + substituteInPlace src/phart/cli.py \ + --replace-fail "renderer.options.use_ascii = args.ascii" "" + + ''; + + dependencies = [ + networkx + ]; + + disabledTestPaths = [ + # Many of the tests are stale + "tests/test_cli.py" + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + pydot + ]; + + pythonImportsCheck = [ + "phart" + ]; + + meta = { + description = "Python Hierarchical ASCII Representation Tool"; + homepage = "https://github.com/scottvr/phart"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ b-rodrigues ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a7fb3fe294f7..b6359b24e97e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11706,6 +11706,8 @@ self: super: with self; { pgvector = callPackage ../development/python-modules/pgvector { }; + phart = callPackage ../development/python-modules/phart { }; + phe = callPackage ../development/python-modules/phe { }; phik = callPackage ../development/python-modules/phik { };