From 203fca9a072ff0c918d0adddeb04a12f766d53c6 Mon Sep 17 00:00:00 2001 From: emaryn Date: Thu, 3 Jul 2025 08:09:24 +0800 Subject: [PATCH] esphome: rename build-systems to build-system and use versionCheckHook --- pkgs/by-name/es/esphome/package.nix | 33 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/es/esphome/package.nix b/pkgs/by-name/es/esphome/package.nix index a1637948f347..04858f46b74d 100644 --- a/pkgs/by-name/es/esphome/package.nix +++ b/pkgs/by-name/es/esphome/package.nix @@ -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-45DhWxBvItl70mx/H42o9PqlIipvzIA/A9H6pKDO2fo="; }; - 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 { };