1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 flit-core,
8
9 # dependenices
10 progress,
11 pyserial,
12
13 # optional-dependencies
14 intelhex,
15
16 # tests
17 pytestCheckHook,
18}:
19
20buildPythonPackage rec {
21 pname = "stm32loader";
22 version = "0.7.1";
23 pyproject = true;
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-QTLSEjdJtDH4GCamnKHN5pEjW41rRtAMXxyZZMM5K3w=";
28 };
29
30 nativeBuildInputs = [ flit-core ];
31
32 propagatedBuildInputs = [
33 progress
34 pyserial
35 ];
36
37 passthru.optional-dependencies = {
38 hex = [ intelhex ];
39 };
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
44
45 pytestFlagsArray = [ "tests/unit" ];
46
47 meta = with lib; {
48 description = "Flash firmware to STM32 microcontrollers in Python";
49 mainProgram = "stm32loader";
50 homepage = "https://github.com/florisla/stm32loader";
51 changelog = "https://github.com/florisla/stm32loader/blob/v${version}/CHANGELOG.md";
52 license = licenses.gpl3;
53 maintainers = [ ];
54 };
55}