evcc: 0.131.8 -> 0.131.10 (#364658)
[NixPkgs.git] / pkgs / development / python-modules / stm32loader / default.nix
blobb27d221d75f46d89c4fc3d03f559b2b81dbbd9fe
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   fetchpatch2,
7   # build-system
8   flit-core,
10   # dependenices
11   progress,
12   pyserial,
14   # optional-dependencies
15   intelhex,
17   # tests
18   pytestCheckHook,
21 buildPythonPackage rec {
22   pname = "stm32loader";
23   version = "0.7.1";
24   pyproject = true;
26   src = fetchPypi {
27     inherit pname version;
28     hash = "sha256-QTLSEjdJtDH4GCamnKHN5pEjW41rRtAMXxyZZMM5K3w=";
29   };
31   patches = [
32     # fix build with python 3.12
33     # https://github.com/florisla/stm32loader/pull/79
34     (fetchpatch2 {
35       url = "https://github.com/florisla/stm32loader/commit/96f59b2984b0d0371b2da0360d6e8d94d0b39a68.patch?full_index=1";
36       hash = "sha256-JUEjQWOnzeMA1OELS214OR7+MYUkCKN5lxwsmRoFbfo=";
37     })
38   ];
40   nativeBuildInputs = [ flit-core ];
42   propagatedBuildInputs = [
43     progress
44     pyserial
45   ];
47   optional-dependencies = {
48     hex = [ intelhex ];
49   };
51   nativeCheckInputs = [
52     pytestCheckHook
53   ] ++ lib.flatten (lib.attrValues optional-dependencies);
55   pytestFlagsArray = [ "tests/unit" ];
57   meta = with lib; {
58     description = "Flash firmware to STM32 microcontrollers in Python";
59     mainProgram = "stm32loader";
60     homepage = "https://github.com/florisla/stm32loader";
61     changelog = "https://github.com/florisla/stm32loader/blob/v${version}/CHANGELOG.md";
62     license = licenses.gpl3;
63     maintainers = [ ];
64   };