esphome: rename build-systems to build-system and use versionCheckHook (#421938)

This commit is contained in:
Aleksana
2025-07-08 18:57:53 +08:00
committed by GitHub
+18 -15
View File
@@ -1,5 +1,6 @@
{
lib,
stdenv,
callPackage,
python3Packages,
fetchFromGitHub,
@@ -8,7 +9,7 @@
esptool,
git,
inetutils,
stdenv,
versionCheckHook,
nixosTests,
}:
@@ -43,9 +44,8 @@ python.pkgs.buildPythonApplication rec {
hash = "sha256-3Xcxn12QKQg0jxdOPP7y01YaikvxmPPX9JL2JBvdsUM=";
};
build-systems = with python.pkgs; [
build-system = with python.pkgs; [
setuptools
argcomplete
];
nativeBuildInputs = [
@@ -123,14 +123,17 @@ python.pkgs.buildPythonApplication rec {
# Needed for tests
__darwinAllowLocalNetworking = true;
nativeCheckInputs = with python3Packages; [
hypothesis
mock
pytest-asyncio
pytest-cov-stub
pytest-mock
pytestCheckHook
];
nativeCheckInputs =
with python3Packages;
[
hypothesis
mock
pytest-asyncio
pytest-cov-stub
pytest-mock
pytestCheckHook
]
++ [ versionCheckHook ];
disabledTests = [
# race condition, also visible in upstream tests
@@ -157,10 +160,6 @@ python.pkgs.buildPythonApplication rec {
export PATH=$PATH:$out/bin
'';
postCheck = ''
$out/bin/esphome --help > /dev/null
'';
postInstall =
let
argcomplete = lib.getExe' python3Packages.argcomplete "register-python-argcomplete";
@@ -172,6 +171,10 @@ python.pkgs.buildPythonApplication rec {
--fish <(${argcomplete} --shell fish esphome)
'';
doInstallCheck = true;
versionCheckProgramArg = "--version";
passthru = {
dashboard = python.pkgs.esphome-dashboard;
updateScript = callPackage ./update.nix { };