Skip to content

Commit

Permalink
kitty: refactor add patch to solve darwin test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
leiserfg committed Mar 11, 2025
1 parent 71b99a1 commit eefb1cc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 8cbdd003e2aba44d7c149ccd4c648504619f9323 Mon Sep 17 00:00:00 2001
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Sat, 8 Mar 2025 10:41:11 +0530
Subject: [PATCH] Make deleting test dir suring shell integration tests robust
against fish 4 background daemon generating completions

---
kitty_tests/shell_integration.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kitty_tests/shell_integration.py b/kitty_tests/shell_integration.py
index 61b4b0a7b..6c97f40d5 100644
--- a/kitty_tests/shell_integration.py
+++ b/kitty_tests/shell_integration.py
@@ -2,6 +2,7 @@
# License: GPLv3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>


+import errno
import os
import shlex
import shutil
@@ -101,8 +102,15 @@ def run_shell(self, shell='zsh', rc='', cmd='', setup_env=None):
i -= 1
yield pty
finally:
- if os.path.exists(home_dir):
- shutil.rmtree(home_dir)
+ while os.path.exists(home_dir):
+ try:
+ shutil.rmtree(home_dir)
+ except OSError as e:
+ # As of fish 4 fish runs a background daemon generating
+ # completions.
+ if e.errno == errno.ENOTEMPTY:
+ continue
+ raise

@unittest.skipUnless(shutil.which('zsh'), 'zsh not installed')
def test_zsh_integration(self):
--
2.48.1

3 changes: 2 additions & 1 deletion pkgs/by-name/ki/kitty/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ buildPythonApplication rec {
# OSError: master_fd is in error condition
./disable-test_ssh_bootstrap_with_different_launchers.patch

# Temporary fix for setup.py until it's merged upstream
# Remove after 0.40.1
./fix_setup.patch
./0001-Make-deleting-test-dir-suring-shell-integration-test.patch
];

hardeningDisable = [
Expand Down

0 comments on commit eefb1cc

Please sign in to comment.