From 80241d2eea464dea28b92b9f4660fa354e819cda Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 4 Nov 2025 18:50:09 -0500 Subject: [PATCH] handle subprocess for windows --- news/print-info-ci.rst | 23 +++++++++++++++++++++++ tests/test_packsmanager.py | 19 ++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 news/print-info-ci.rst diff --git a/news/print-info-ci.rst b/news/print-info-ci.rst new file mode 100644 index 0000000..27fc85d --- /dev/null +++ b/news/print-info-ci.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news needed. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/tests/test_packsmanager.py b/tests/test_packsmanager.py index 10bf5ab..ffdc78a 100644 --- a/tests/test_packsmanager.py +++ b/tests/test_packsmanager.py @@ -372,27 +372,24 @@ def test_print_info(packs_to_install, expected, example_cases, capsys): case5dir = example_cases / "case5" env_dir = case5dir / "fake_env" req_dir = case5dir / "requirements" / "packs" + # Handle Windows path format + env_dir_str = env_dir.as_posix() + shell = os.name == "nt" subprocess.run( - ["conda", "create", "-y", "-p", str(env_dir)], + ["conda", "create", "-y", "-p", env_dir_str], check=True, capture_output=True, text=True, + shell=shell, ) for pack in packs_to_install: - req_file = req_dir / f"{pack}.txt" + req_file = (req_dir / f"{pack}.txt").as_posix() subprocess.run( - [ - "conda", - "install", - "-y", - "--file", - str(req_file), - "-p", - str(env_dir), - ], + ["conda", "install", "-y", "--file", req_file, "-p", env_dir_str], check=True, capture_output=True, text=True, + shell=shell, ) pm = PacksManager(root_path=case5dir) pm.print_info()