Repository: gabrieldemarmiesse/python-on-whales (language: python)

Issue:
docker compose build --no-cache option missing
I noticed that the docker compose component doesn't support all of the options for the `build` command:

```bash
docker compose build --help

Usage:  docker compose build [SERVICE...]

Build or rebuild services

Options:
      --build-arg stringArray   Set build-time variables for services.
      --no-cache                Do not use cache when building the image
      --progress string         Set type of progress output (auto, tty, plain, quiet) (default "auto")
      --pull                    Always attempt to pull a newer version of the image.
  -q, --quiet                   Don't print anything to STDOUT
      --ssh string              Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)
 ```
 
 Would be nice to have the `--no-cache` option so whenever we make changes to an image we can build it appropriately.
 


Discussion / hints:
Thanks for the report! That seems easy to do. You can either make a pull request, or I'll do it myself at some point next week :) 

Fix patch:
diff --git a/python_on_whales/components/compose/cli_wrapper.py b/python_on_whales/components/compose/cli_wrapper.py
index c27983ec..726517e0 100644
--- a/python_on_whales/components/compose/cli_wrapper.py
+++ b/python_on_whales/components/compose/cli_wrapper.py
@@ -8,18 +8,47 @@
 import python_on_whales.components.container.cli_wrapper
 from python_on_whales.client_config import DockerCLICaller
 from python_on_whales.components.compose.models import ComposeConfig
-from python_on_whales.utils import run, stream_stdout_and_stderr, to_list
+from python_on_whales.utils import (
+    format_dict_for_cli,
+    run,
+    stream_stdout_and_stderr,
+    to_list,
+)
 
 
 class ComposeCLI(DockerCLICaller):
-    def build(self, services: List[str] = []):
+    def build(
+        self,
+        services: List[str] = [],
+        build_args: Dict[str, str] = {},
+        cache: bool = True,
+        progress: Optional[str] = None,
+        pull: bool = False,
+        quiet: bool = False,
+        ssh: Optional[str] = None,
+    ):
         """Build services declared in a yaml compose file.
 
         # Arguments
             services: The services to build (as strings).
                 If empty (default), all services are built.
+            build_arguments: Set build-time variables for services. For example
+                 `build_args={"PY_VERSION": "3.7.8", "UBUNTU_VERSION": "20.04"}`.
+            cache: Set to `False` if you don't want to use the cache to build your images
+            progress: Set type of progress output (auto, tty, plain, quiet) (default "auto")
+            pull: Set to `True` to always attempt to pull a newer version of the
+                image (in the `FROM` statements for example).
+            quiet: Don't print anything
+            ssh: Set SSH authentications used when building service images.
+                (use `'default'` for using your default SSH Agent)
         """
         full_cmd = self.docker_compose_cmd + ["build"]
+        full_cmd.add_args_list("--build-arg", format_dict_for_cli(build_args))
+        full_cmd.add_flag("--no-cache", not cache)
+        full_cmd.add_simple_arg("--progress", progress)
+        full_cmd.add_flag("--pull", pull)
+        full_cmd.add_flag("--quiet", quiet)
+        full_cmd.add_simple_arg("--ssh", ssh)
         full_cmd += services
         run(full_cmd, capture_stdout=False)
 


Test patch:
diff --git a/tests/python_on_whales/components/test_compose.py b/tests/python_on_whales/components/test_compose.py
index d627c969..dffbbda3 100644
--- a/tests/python_on_whales/components/test_compose.py
+++ b/tests/python_on_whales/components/test_compose.py
@@ -51,6 +51,17 @@ def test_docker_compose_build():
     docker.image.remove("some_random_image")
 
 
+def test_docker_compose_build_with_arguments():
+    docker.compose.build(
+        build_args={"PYTHON_VERSION": "3.7"},
+        cache=False,
+        progress="plain",
+        pull=True,
+        quiet=True,
+    )
+    docker.image.remove("some_random_image")
+
+
 def test_docker_compose_up_down():
     docker = DockerClient(
         compose_files=[