From 128512d54bf689da895b20c26058a2e1577b10d6 Mon Sep 17 00:00:00 2001 From: Leandro Reina Date: Tue, 19 Sep 2023 10:10:40 +0200 Subject: [PATCH 1/2] python311Packages.pycyphal: init at 1.15.2 --- .../python-modules/pycyphal/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 12 +++++ 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/pycyphal/default.nix diff --git a/pkgs/development/python-modules/pycyphal/default.nix b/pkgs/development/python-modules/pycyphal/default.nix new file mode 100644 index 000000000000..b5516bc144e0 --- /dev/null +++ b/pkgs/development/python-modules/pycyphal/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, can +, cobs +, libpcap +, nunavut +, numpy +, pyserial +}: + +buildPythonPackage rec { + pname = "pycyphal"; + version = "1.15.2"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-KVX+DwcJp1sjpcG1Utl9me1LwWDZPof+O6hoUt1xlXA="; + }; + + propagatedBuildInputs = [ + can + cobs + libpcap + numpy + nunavut + pyserial + ]; + + # Can't seem to run the tests on nix + doCheck = false; + pythonImportsCheck = [ + "pycyphal" + ]; + + meta = with lib; { + description = "A full-featured implementation of the Cyphal protocol stack in Python"; + longDescription = '' + Cyphal is an open technology for real-time intravehicular distributed computing and communication based on modern networking standards (Ethernet, CAN FD, etc.). + ''; + homepage = "https://opencyphal.org/"; + license = licenses.mit; + maintainers = [ teams.ororatech ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 52f58a04875c..0cdfb1cd89aa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9027,6 +9027,18 @@ self: super: with self; { pycxx = callPackage ../development/python-modules/pycxx { }; + pycyphal = callPackage ../development/python-modules/pycyphal { + # Does not yet support nunavut 2+, use latest 1.X version instead + # https://github.com/OpenCyphal/pycyphal/issues/277 + nunavut = self.nunavut.overridePythonAttrs (prev: rec { + version = "1.9.0"; + src = prev.src.override { + inherit version; + hash = "sha256-KhgijXJ908uxM7VZdXo1WU/RGU0cfqctBCbpF2wOcy8="; + }; + }); + }; + pydaikin = callPackage ../development/python-modules/pydaikin { }; pydal = callPackage ../development/python-modules/pydal { }; From 0f465f79819cf1726a9cd0e60496cedf4559e858 Mon Sep 17 00:00:00 2001 From: Leandro Reina Date: Tue, 19 Sep 2023 10:53:06 +0200 Subject: [PATCH 2/2] yakut: init at 0.13.0 --- pkgs/development/tools/misc/yakut/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/tools/misc/yakut/default.nix diff --git a/pkgs/development/tools/misc/yakut/default.nix b/pkgs/development/tools/misc/yakut/default.nix new file mode 100644 index 000000000000..4c993c19cdcf --- /dev/null +++ b/pkgs/development/tools/misc/yakut/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonApplication +, fetchPypi +, stdenv +, click +, coloredlogs +, psutil +, pycyphal +, pyserial +, ruamel-yaml +, requests +, scipy +, simplejson +}: + +buildPythonApplication rec { + pname = "yakut"; + version = "0.13.0"; + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-MBVSt01D36rBPW2bopujyu8Opwwavmm7S3tdaWp5ACw="; + }; + + buildInputs = [ + stdenv.cc.cc.lib + click + coloredlogs + psutil + pycyphal + pyserial + ruamel-yaml + requests + scipy + simplejson + ]; + + # Can't seem to run the tests on nix + doCheck = false; + + meta = with lib; { + description = "Simple CLI tool for diagnostics and debugging of Cyphal networks"; + longDescription = '' + YakĂșt is a simple cross-platform command-line interface (CLI) tool for diagnostics and debugging of Cyphal networks. By virtue of being based on PyCyphal, Yakut supports all Cyphal transports (UDP, serial, CAN, ...) and is compatible with all major features of the protocol. It is designed to be usable with GNU/Linux, Windows, and macOS. + ''; + homepage = "https://github.com/OpenCyphal/yakut/"; + license = licenses.mit; + maintainers = [ teams.ororatech ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8114377a37c2..ffd64d17835f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18541,6 +18541,8 @@ with pkgs; teller = callPackage ../development/tools/teller { }; + yakut = python3Packages.callPackage ../development/tools/misc/yakut { }; + ### DEVELOPMENT / TOOLS / LANGUAGE-SERVERS ansible-language-server = callPackage ../development/tools/language-servers/ansible-language-server { };