Skip to content

Commit

Permalink
✨ docker.compose.down() can take str as service arg (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldemarmiesse authored Mar 9, 2024
1 parent 20aebfb commit bf1c60d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python_on_whales/components/compose/cli_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ComposeCLI(DockerCLICaller):
@overload
def build(
self,
services: Optional[List[str]] = ...,
services: Union[List[str], str, None] = ...,
build_args: Dict[str, str] = ...,
cache: bool = ...,
progress: Optional[str] = ...,
Expand All @@ -38,7 +38,7 @@ def build(
@overload
def build(
self,
services: Optional[List[str]] = ...,
services: Union[List[str], str, None] = ...,
build_args: Dict[str, str] = ...,
cache: bool = ...,
progress: Optional[str] = ...,
Expand All @@ -51,7 +51,7 @@ def build(

def build(
self,
services: Optional[List[str]] = None,
services: Union[List[str], str, None] = None,
build_args: Dict[str, str] = {},
cache: bool = True,
progress: Optional[str] = None,
Expand Down Expand Up @@ -99,7 +99,9 @@ def build(
if services == []:
return
elif services is not None:
full_cmd += services
full_cmd += to_list(services)
else:
pass # passing nothing means all services are built
if stream_logs:
return stream_stdout_and_stderr(full_cmd)
else:
Expand Down
1 change: 1 addition & 0 deletions tests/python_on_whales/components/test_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_compose_project_name():
def test_docker_compose_build():
docker.compose.build()
docker.compose.build(["my_service"])
docker.compose.build("my_service")
docker.image.remove("some_random_image")


Expand Down

0 comments on commit bf1c60d

Please sign in to comment.