diff --git a/pkgs/development/python-modules/stm32loader/default.nix b/pkgs/development/python-modules/stm32loader/default.nix index 55a86231aa70..00de51ea66f5 100644 --- a/pkgs/development/python-modules/stm32loader/default.nix +++ b/pkgs/development/python-modules/stm32loader/default.nix @@ -1,30 +1,53 @@ { lib , buildPythonPackage -, isPy27 , fetchPypi + +# build-system +, flit-core + +# dependenices , progress , pyserial -, pytest -, mock + +# optional-dependencies +, intelhex + +# tests +, pytestCheckHook }: buildPythonPackage rec { pname = "stm32loader"; - version = "0.5.1"; - format = "setuptools"; + version = "0.7.1"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "0135qzxlrivvkq6wgkw7shfz94n755qs2c1754p1hc2jk0nqayrg"; + hash = "sha256-QTLSEjdJtDH4GCamnKHN5pEjW41rRtAMXxyZZMM5K3w="; }; - propagatedBuildInputs = [ progress pyserial ]; + nativeBuildInputs = [ + flit-core + ]; - nativeCheckInputs = [ pytest ] ++ lib.optional isPy27 mock; + propagatedBuildInputs = [ + progress + pyserial + ]; - checkPhase = '' - pytest --strict tests/unit - ''; + 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";