nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 dlms-cosem,
5 fetchFromGitHub,
6 pyserial,
7 pyserial-asyncio-fast,
8 pytestCheckHook,
9 pythonAtLeast,
10 pytz,
11 setuptools,
12 tailer,
13}:
14
15buildPythonPackage rec {
16 pname = "dsmr-parser";
17 version = "1.4.3";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "ndokter";
22 repo = "dsmr_parser";
23 tag = "v${version}";
24 hash = "sha256-jBrcliN63isFKMqgaFIAPP/ALDdtL/O9mCN8Va+g+NE=";
25 };
26
27 pythonRelaxDeps = [ "dlms_cosem" ];
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 dlms-cosem
33 pyserial
34 pyserial-asyncio-fast
35 pytz
36 tailer
37 ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 disabledTests = lib.optionals (pythonAtLeast "3.12") [ "test_receive_packet" ];
42
43 pythonImportsCheck = [ "dsmr_parser" ];
44
45 meta = {
46 description = "Python module to parse Dutch Smart Meter Requirements (DSMR)";
47 homepage = "https://github.com/ndokter/dsmr_parser";
48 changelog = "https://github.com/ndokter/dsmr_parser/releases/tag/${src.tag}";
49 license = with lib.licenses; [ mit ];
50 maintainers = with lib.maintainers; [ fab ];
51 mainProgram = "dsmr_console";
52 };
53}