From 922ee6c1ef42043b194096012c42a8b7bd6cd78f Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Sat, 14 Jun 2025 01:44:02 +0800 Subject: [PATCH 1/2] fix: mkdir in accelerate --- swankit/core/settings.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/swankit/core/settings.py b/swankit/core/settings.py index 125ab56..8d575e0 100644 --- a/swankit/core/settings.py +++ b/swankit/core/settings.py @@ -127,8 +127,11 @@ def mkdir(self, path: str) -> None: """创建目录 为了保证安全性,不会递归创建 """ - if not os.path.exists(path) and self.should_save: - os.mkdir(path) + try: + if not os.path.exists(path) and self.should_save: + os.mkdir(path) + except FileExistsError: # https://github.com/SwanHubX/SwanLab/issues/1090 + pass # ---------------------------------- 静态属性 ---------------------------------- From 69fe56a354bd487805c0d3ec6f2161a3b89cf23a Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Sat, 14 Jun 2025 01:45:10 +0800 Subject: [PATCH 2/2] feat: new version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9b3b18f..dd04fe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "hatchling.build" [project] name = "swankit" -version = "0.2.3" +version = "0.2.4" dynamic = ["readme", "dependencies"] description = "Base toolkit for SwanLab" license = "Apache-2.0"