From a46ee196ec45c360af7b98dd30b27959567f5c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Thu, 10 Apr 2025 13:57:35 +0200 Subject: [PATCH 1/5] Escape path on windows in upload command --- solvebio/cli/data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 08b394cc..3b103e9b 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -151,8 +151,11 @@ def _upload_folder( for abs_local_parent_path, folders, files in os.walk(base_local_path): # Strips off the local path and adds the parent directory at # each phase of the loop + base_local_path_dirname = os.path.dirname(base_local_path) + if os.name == "nt": + base_local_path_dirname = re.escape(os.path.dirname(base_local_path)) local_parent_path = re.sub( - "^" + os.path.dirname(base_local_path), "", abs_local_parent_path + "^" + base_local_path_dirname, "", abs_local_parent_path ).lstrip("/") if should_exclude(abs_local_parent_path, exclude_paths, dry_run=dry_run): From 700c0f5a3732cd5384d402aab73ab8f02b2bfa20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Thu, 10 Apr 2025 14:27:21 +0200 Subject: [PATCH 2/5] print api-host --- solvebio/test/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solvebio/test/helper.py b/solvebio/test/helper.py index a42e76ee..c080b793 100644 --- a/solvebio/test/helper.py +++ b/solvebio/test/helper.py @@ -26,6 +26,8 @@ def setUp(self): super(SolveBioTestCase, self).setUp() api_key = os.environ.get('SOLVEBIO_API_KEY', None) api_host = os.environ.get('SOLVEBIO_API_HOST', None) + print(api_host) + self.client = solvebio.SolveClient(host=api_host, token=api_key) def check_response(self, response, expect, msg): From 29140ce60c6d432db8f55237282538dc5c64724b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Thu, 10 Apr 2025 14:29:53 +0200 Subject: [PATCH 3/5] remove print --- solvebio/test/helper.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/solvebio/test/helper.py b/solvebio/test/helper.py index c080b793..a42e76ee 100644 --- a/solvebio/test/helper.py +++ b/solvebio/test/helper.py @@ -26,8 +26,6 @@ def setUp(self): super(SolveBioTestCase, self).setUp() api_key = os.environ.get('SOLVEBIO_API_KEY', None) api_host = os.environ.get('SOLVEBIO_API_HOST', None) - print(api_host) - self.client = solvebio.SolveClient(host=api_host, token=api_key) def check_response(self, response, expect, msg): From b4f60d2903cec6017a0f7847c8c68b6e13812622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Thu, 10 Apr 2025 16:50:07 +0200 Subject: [PATCH 4/5] remote folder full path fix on Windows --- solvebio/cli/data.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 3b103e9b..145155ee 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -163,6 +163,9 @@ def _upload_folder( remote_folder_full_path = os.path.join(base_remote_path, local_parent_path) + if os.name == "nt": + remote_folder_full_path = os.path.join(base_remote_path, local_parent_path.replace("\\", "/")) + # Create folders for folder in folders: new_folder_path = os.path.join(abs_local_parent_path, folder) From 3f9bec0b9c963cf727486e0c823e501498b3e9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Thu, 10 Apr 2025 18:34:36 +0200 Subject: [PATCH 5/5] remote folder full path fix on Windows --- solvebio/cli/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 145155ee..d46850f6 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -164,7 +164,7 @@ def _upload_folder( remote_folder_full_path = os.path.join(base_remote_path, local_parent_path) if os.name == "nt": - remote_folder_full_path = os.path.join(base_remote_path, local_parent_path.replace("\\", "/")) + remote_folder_full_path = base_remote_path + "/" + local_parent_path.lstrip("\\").replace("\\", "/") # Create folders for folder in folders: