refactor: update Jupyter notebooks to prevent kernel exit during GitHub Actions

This commit is contained in:
Daulet Amirkhanov 2025-08-27 15:37:29 +01:00
parent 4f6e19f8de
commit f339b27dfa
3 changed files with 24 additions and 3 deletions

View file

@ -1808,8 +1808,15 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Only exit in interactive mode, not during GitHub Actions\n",
"import os\n", "import os\n",
"os._exit(0)" "\n",
"# Skip exit if we're running in GitHub Actions\n",
"if not os.environ.get('GITHUB_ACTIONS'):\n",
" print(\"Exiting kernel to clean up resources...\")\n",
" os._exit(0)\n",
"else:\n",
" print(\"Skipping kernel exit - running in GitHub Actions\")"
] ]
}, },
{ {

View file

@ -896,8 +896,15 @@
} }
], ],
"source": [ "source": [
"# Only exit in interactive mode, not during GitHub Actions\n",
"import os\n", "import os\n",
"os._exit(0)" "\n",
"# Skip exit if we're running in GitHub Actions\n",
"if not os.environ.get('GITHUB_ACTIONS'):\n",
" print(\"Exiting kernel to clean up resources...\")\n",
" os._exit(0)\n",
"else:\n",
" print(\"Skipping kernel exit - running in GitHub Actions\")"
] ]
}, },
{ {

View file

@ -1149,8 +1149,15 @@
} }
], ],
"source": [ "source": [
"# Only exit in interactive mode, not during GitHub Actions\n",
"import os\n", "import os\n",
"os._exit(0)" "\n",
"# Skip exit if we're running in GitHub Actions\n",
"if not os.environ.get('GITHUB_ACTIONS'):\n",
" print(\"Exiting kernel to clean up resources...\")\n",
" os._exit(0)\n",
"else:\n",
" print(\"Skipping kernel exit - running in GitHub Actions\")"
] ]
} }
], ],