nixpkgs/pkgs/development/python-modules/universal-silabs-flasher/default.nix
Robert Schütz adf2ec46c7 python3Packages.gpiod: rename from libgpiod
On PyPI the package is called gpiod and that's also what's listed as its
name in the METADATA file.
2026-03-30 10:10:04 -07:00

80 lines
1.6 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
bellows,
click,
coloredlogs,
crc,
gpiod,
pyserial-asyncio-fast,
typing-extensions,
zigpy,
# tests
pytestCheckHook,
pytest-asyncio,
pytest-mock,
pytest-timeout,
}:
buildPythonPackage rec {
pname = "universal-silabs-flasher";
version = "0.1.3";
pyproject = true;
src = fetchFromGitHub {
owner = "NabuCasa";
repo = "universal-silabs-flasher";
tag = "v${version}";
hash = "sha256-VBMxm953xp0qt4MIfOSjFNQu2jOh52uQ9Zz94NWy3dY=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"setuptools-git-versioning>=2.0,<3"' "" \
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
'';
build-system = [ setuptools ];
dependencies = [
bellows
click
coloredlogs
crc
pyserial-asyncio-fast
typing-extensions
zigpy
]
++ lib.optionals (stdenv.hostPlatform.isLinux) [ gpiod ];
nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
pytest-mock
pytest-timeout
];
disabledTests = [
# timing sensitive
"test_xmodem_happy_path"
];
pythonImportsCheck = [ "universal_silabs_flasher" ];
meta = {
changelog = "https://github.com/NabuCasa/universal-silabs-flasher/releases/tag/${src.tag}";
description = "Flashes Silicon Labs radios running EmberZNet or CPC multi-pan firmware";
mainProgram = "universal-silabs-flasher";
homepage = "https://github.com/NabuCasa/universal-silabs-flasher";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ hexa ];
};
}