Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 24, 2024
1 parent 13ea75a commit 35b0fb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion aiidalab_launch/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ async def _async_start(
)

for extra_mount in profile.extra_mounts:
source, target, rw_mode, mount_type = profile.parse_extra_mount(extra_mount)
source, target, rw_mode, mount_type = profile.parse_extra_mount(
extra_mount
)
click.secho(
MSG_EXTRA_MOUNT.format(
source=source,
Expand Down
4 changes: 3 additions & 1 deletion aiidalab_launch/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def _home_mount(self) -> docker.types.Mount:
)

def _extra_mount(self, extra_mount: str) -> docker.types.Mount:
source_path, target_path, mode, mount_type = self.profile.parse_extra_mount(extra_mount)
source_path, target_path, mode, mount_type = self.profile.parse_extra_mount(
extra_mount
)
return docker.types.Mount(
target=str(target_path),
source=str(source_path),
Expand Down
4 changes: 1 addition & 3 deletions aiidalab_launch/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def _get_mount_type(source: str) -> str:
# we assume volume mount, whose name is restricted by Docker.
if Path(source).is_absolute():
return "bind"
if not re.fullmatch(
_REGEX_VALID_IMAGE_NAMES, source
):
if not re.fullmatch(_REGEX_VALID_IMAGE_NAMES, source):
raise ValueError(
f"Invalid extra mount volume name '{source}'. Use absolute path for bind mounts."
)
Expand Down

0 comments on commit 35b0fb7

Please sign in to comment.