about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/stm32loader/default.nix
blob: 00de51ea66f5b8bfe25e290927a866cf0eadc004 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, buildPythonPackage
, fetchPypi

# build-system
, flit-core

# dependenices
, progress
, pyserial

# optional-dependencies
, intelhex

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "stm32loader";
  version = "0.7.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-QTLSEjdJtDH4GCamnKHN5pEjW41rRtAMXxyZZMM5K3w=";
  };

  nativeBuildInputs = [
    flit-core
  ];

  propagatedBuildInputs = [
    progress
    pyserial
  ];

  passthru.optional-dependencies = {
    hex = [
      intelhex
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);

  pytestFlagsArray = [
    "tests/unit"
  ];

  meta = with lib; {
    description = "Flash firmware to STM32 microcontrollers in Python";
    homepage = "https://github.com/florisla/stm32loader";
    changelog = "https://github.com/florisla/stm32loader/blob/v${version}/CHANGELOG.md";
    license = licenses.gpl3;
    maintainers = with maintainers; [ emily ];
  };
}