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