1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6}:
7
8buildPythonPackage rec {
9 pname = "cobs";
10 version = "1.2.2";
11 format = "setuptools";
12
13 disabled = pythonOlder "3.6";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-291eMhEdcnhvg9DCaSFdzWrGKbGsGWLGh4Ih87LKmNo=";
18 };
19
20 checkPhase = ''
21 runHook preCheck
22
23 python -m cobs.cobs.test
24 python -m cobs.cobsr.test
25
26 runHook postCheck
27 '';
28
29 pythonImportsCheck = [
30 "cobs"
31 "cobs.cobs"
32 "cobs.cobsr"
33 ];
34
35 meta = with lib; {
36 description = "Python functions for encoding and decoding COBS";
37 longDescription = ''
38 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.
39 '';
40 homepage = "https://github.com/cmcqueen/cobs-python/";
41 license = licenses.mit;
42 teams = [ teams.ororatech ];
43 };
44}