Skip to content

Commit 70cde20

Browse files
committed
no assert
1 parent 300330c commit 70cde20

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

builder/penv_setup.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ def setup_pipenv_in_package(env, penv_dir):
127127

128128
# Validate virtual environment creation
129129
# Ensure Python executable is available
130-
assert os.path.isfile(
131-
get_executable_path(penv_dir, "python")
132-
), f"Error: Failed to create a proper virtual environment. Missing the `python` binary! Created with uv: {uv_success}"
133-
130+
penv_python = get_executable_path(penv_dir, "python")
131+
if not os.path.isfile(penv_python):
132+
sys.stderr.write(
133+
f"Error: Failed to create a proper virtual environment. "
134+
f"Missing the `python` binary at {penv_python}! Created with uv: {uv_success}\n"
135+
)
136+
sys.exit(1)
137+
134138
return uv_cmd if uv_success else None
135139

136140
return None
@@ -530,9 +534,13 @@ def _setup_pipenv_minimal(penv_dir):
530534

531535
# Validate virtual environment creation
532536
# Ensure Python executable is available
533-
assert os.path.isfile(
534-
get_executable_path(penv_dir, "python")
535-
), f"Error: Failed to create a proper virtual environment. Missing the `python` binary! Created with uv: {uv_success}"
537+
penv_python = get_executable_path(penv_dir, "python")
538+
if not os.path.isfile(penv_python):
539+
sys.stderr.write(
540+
f"Error: Failed to create a proper virtual environment. "
541+
f"Missing the `python` binary at {penv_python}! Created with uv: {uv_success}\n"
542+
)
543+
sys.exit(1)
536544

537545
return uv_cmd if uv_success else None
538546

0 commit comments

Comments
 (0)