From 436400a6ee91af6512018c5e30a841fcbcc9e6fb Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Thu, 27 Aug 2026 10:43:24 -0400 Subject: [PATCH] ghstack: modernize Signed-off-by: Ethan Carter Edwards --- pkgs/by-name/gh/ghstack/package.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/gh/ghstack/package.nix b/pkgs/by-name/gh/ghstack/package.nix index bb141a4fdbad..6f89919c2bed 100644 --- a/pkgs/by-name/gh/ghstack/package.nix +++ b/pkgs/by-name/gh/ghstack/package.nix @@ -1,14 +1,18 @@ { lib, - python3, + python3Packages, fetchFromGitHub, + versionCheckHook, + writableTmpDirAsHomeHook, }: -python3.pkgs.buildPythonApplication (finalAttrs: { +python3Packages.buildPythonApplication (finalAttrs: { pname = "ghstack"; version = "0.13.0"; pyproject = true; + __structuredAttrs = true; + src = fetchFromGitHub { owner = "ezyang"; repo = "ghstack"; @@ -21,9 +25,9 @@ python3.pkgs.buildPythonApplication (finalAttrs: { --replace-fail 'requires = ["uv_build>=0.6,<0.7"]' 'requires = ["uv_build>=0.6"]' ''; - build-system = [ python3.pkgs.uv-build ]; + build-system = [ python3Packages.uv-build ]; - dependencies = with python3.pkgs; [ + dependencies = with python3Packages; [ aiohttp click flake8 @@ -34,6 +38,14 @@ python3.pkgs.buildPythonApplication (finalAttrs: { pythonImportsCheck = [ "ghstack.cli" ]; + # pytests require sqlite db access + + versionCheckKeepEnvironment = [ "HOME" ]; + nativeCheckInputs = [ + versionCheckHook + writableTmpDirAsHomeHook + ]; + meta = { description = "Submit stacked diffs to GitHub on the command line"; homepage = "https://github.com/ezyang/ghstack";