Skip to content

Commit

Permalink
Compute: avoid confusion by denying __main__.py in bundle (#12504)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: a5addd1c7035d5e4e6e6184a1d623e90af533750
  • Loading branch information
alorenzo175 authored and Descartes Labs Build committed Mar 21, 2024
1 parent 836696e commit c64b949
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions descarteslabs/core/compute/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,14 @@ def _data_globs_to_paths(self) -> List[str]:
)
)
else:
data_files.append(
(
path,
self._archive_path(
path, None, sys_path=self._sys_path_prefix(path)
),
),
archive_path = self._archive_path(
path, None, sys_path=self._sys_path_prefix(path)
)
if archive_path == "__main__.py":
raise ValueError(
f"{pattern} includes a file with the forbidden relative path `__main__.py`"
)
data_files.append((path, archive_path))
else:
raise ValueError(f"Data file does not exist: {path}")

Expand Down

0 comments on commit c64b949

Please sign in to comment.