diff --git a/pkgs/development/python-modules/canals/default.nix b/pkgs/development/python-modules/canals/default.nix new file mode 100644 index 000000000000..6832a3626132 --- /dev/null +++ b/pkgs/development/python-modules/canals/default.nix @@ -0,0 +1,70 @@ +{ lib +, buildPythonPackage +, pythonOlder +, pythonAtLeast +, fetchFromGitHub +# native build inputs +, hatchling +# build input +, networkx +# check inputs +, pytestCheckHook +# optional dependencies +, pygraphviz +, requests +, mkdocs-material +, mkdocs-mermaid2-plugin +, mkdocstrings +}: +let + pname = "canals"; + version = "0.2.2"; + optional-dependencies = { + graphviz = [ pygraphviz ]; + mermaid = [ requests ]; + docs = [ mkdocs-material mkdocs-mermaid2-plugin mkdocstrings ]; + }; +in +buildPythonPackage { + inherit version pname; + format = "pyproject"; + + # Pypi source package doesn't contain tests + src = fetchFromGitHub { + owner = "deepset-ai"; + repo = pname; + rev = "v${version}"; + hash = "sha256-dF0bkY4DFJIovaseNiOLgF8lmha+njTTTzr2/4LzZEc="; + }; + + disabled = pythonOlder "3.8"; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + networkx + ]; + + passthru = { inherit optional-dependencies; }; + + nativeCheckInputs = [ + pytestCheckHook + ] ++ optional-dependencies.mermaid; + + disabledTestPaths = [ + # requires internet connection to mermaid.ink + "test/pipelines/integration" + ]; + + pythonImportsCheck = [ "canals" ]; + + meta = with lib; { + description = "A component orchestration engine"; + homepage = "https://github.com/deepset-ai/canals"; + changelog = "https://github.com/deepset-ai/canals/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b2fe97d01705..108029471b6c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1655,6 +1655,8 @@ self: super: with self; { can = callPackage ../development/python-modules/can { }; + canals = callPackage ../development/python-modules/canals { }; + canmatrix = callPackage ../development/python-modules/canmatrix { }; canonicaljson = callPackage ../development/python-modules/canonicaljson { };