about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/cobs/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
commitaa4353b499e6950b7333578f936455a628145c31 (patch)
treec6332cedece2327a18d08794755b3fc0f9f1905b /nixpkgs/pkgs/development/python-modules/cobs/default.nix
parentac456d475f4e50818499b804359355c0f3b4bbf7 (diff)
parent52185f4d76c18d8348f963795dfed1de018e8dfe (diff)
downloadnixlib-aa4353b499e6950b7333578f936455a628145c31.tar
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.gz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.bz2
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.lz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.xz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.zst
nixlib-aa4353b499e6950b7333578f936455a628145c31.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/cobs/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/cobs/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/cobs/default.nix b/nixpkgs/pkgs/development/python-modules/cobs/default.nix
new file mode 100644
index 000000000000..4ea171d94291
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/cobs/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "cobs";
+  version = "1.2.0";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-2TsQtTcNyIaJYK77cK2x9zpOYQexaRgwekru79PtuPY=";
+  };
+
+  checkPhase = ''
+    runHook preCheck
+
+    python -m cobs.cobs.test
+    python -m cobs.cobsr.test
+
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [
+    "cobs"
+    "cobs.cobs"
+    "cobs.cobsr"
+  ];
+
+  meta = with lib; {
+    description = "Python functions for encoding and decoding COBS";
+    longDescription = ''
+      COBS is a method of encoding a packet of bytes into a form that contains no bytes with value zero (0x00). The input packet of bytes can contain bytes in the full range of 0x00 to 0xFF. The COBS encoded packet is guaranteed to generate packets with bytes only in the range 0x01 to 0xFF. Thus, in a communication protocol, packet boundaries can be reliably delimited with 0x00 bytes.
+    '';
+    homepage = "https://github.com/cmcqueen/cobs-python/";
+    license = licenses.mit;
+    maintainers = [ teams.ororatech ];
+  };
+}