Skip to content

Commit 649f13b

Browse files
committed
Try force shorter path
1 parent 6cbcd77 commit 649f13b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/test_examples.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,18 @@ def _install_dir_for(
664664
workspace: Path,
665665
config_filename: str,
666666
with_spaces: bool,
667+
short: bool = False,
667668
) -> Path:
668669
install_dir_prefix = "i n s t a l l" if with_spaces else "install"
669670
if installer.suffix == ".pkg" and ON_CI:
670671
return Path("~").expanduser() / calculate_install_dir(input_dir / config_filename)
671672
elif installer.suffix == ".msi":
672673
return calculate_msi_install_path(input_dir / config_filename)
674+
elif short:
675+
# Each parametrized test already has its own workspace, so the installer
676+
# stem/suffix are not needed to keep install dirs distinct. Keeping the
677+
# name short avoids exceeding MAX_PATH on Windows (see from_env_txt).
678+
return workspace / install_dir_prefix
673679
else:
674680
return workspace / f"{install_dir_prefix}-{installer.stem}-{installer.suffix[1:]}"
675681

@@ -711,7 +717,9 @@ def create_single_installer(
711717
installer = next(output_dir.glob(f"*.{installer_type}"), None)
712718
if installer is None:
713719
raise FileNotFoundError(f"No .{installer_type} installer found in {output_dir}")
714-
install_dir = _install_dir_for(installer, input_dir, workspace, config_filename, with_spaces)
720+
install_dir = _install_dir_for(
721+
installer, input_dir, workspace, config_filename, with_spaces, short=True
722+
)
715723
return installer, install_dir
716724

717725

0 commit comments

Comments
 (0)