diff --git a/pkgs/development/python-modules/pyuavcan/default.nix b/pkgs/development/python-modules/pyuavcan/default.nix new file mode 100644 index 000000000000..0c78b3059593 --- /dev/null +++ b/pkgs/development/python-modules/pyuavcan/default.nix @@ -0,0 +1,50 @@ +{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, numpy, nunavut +, pyserial , pytest, ruamel_yaml}: + + buildPythonPackage rec { + pname = "pyuavcan"; + version = "1.1.0.dev1"; + disabled = pythonOlder "3.7"; # only python>=3.7 is supported + + src = fetchFromGitHub { + owner = "UAVCAN"; + repo = pname; + rev = version; + sha256 = "0fmbmdnnh679zkllv5m6pkrasg7m9vjwabqnmz5m7flrgdh6h4qa"; + }; + + propagatedBuildInputs = [ + numpy + nunavut + pyserial + pytest + ruamel_yaml + ]; + + # allow for writable directory for darwin + preBuild = '' + export HOME=$TMPDIR + export PYTHONASYNCIODEBUG=1 + ''; + + # tests fail ATM. + doCheck = false; + + # check at least that import works, as tests fail + pythonImportsCheck = [ + "pyuavcan" + ]; + + meta = with lib; { + description = "A full-featured implementation of the UAVCAN protocol stack"; + longDescription = '' + It is intended for non-embedded, user-facing applications such as GUI + software, diagnostic tools, automation scripts, prototypes, and various + R&D cases. PyUAVCAN consists of a Python library (package) and a simple + CLI tool for basic diagnostics and shell script automation. + ''; + homepage = "https://pyuavcan.readthedocs.io"; + maintainers = with maintainers; [ wucke13 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cd9d8de823eb..333b589af3a2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1617,6 +1617,17 @@ in { inherit (pkgs.darwin.apple_sdk.frameworks) ApplicationServices CoreServices; }; + pyuavcan = callPackage ../development/python-modules/pyuavcan { + # this version pinpoint to anold version is necessary due to a regression + nunavut = self.nunavut.overridePythonAttrs ( old: rec { + version = "0.2.3"; + src = old.src.override { + inherit version; + sha256 = "0x8a9h4mc2r2yz49s9arsbs4bn3h25mvmg4zbgksm9hcyi9536x5"; + }; + }); + }; + pyunifi = callPackage ../development/python-modules/pyunifi { }; vdf = callPackage ../development/python-modules/vdf { };