Skip to content

Commit 00aff6b

Browse files
committed
style: fix linting
1 parent db2005b commit 00aff6b

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

autonomy/cli/build_images.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@
7878
help='Override the configured docker builder instance (default "default").',
7979
)
8080
@click.option("--push", is_flag=True, help="Push image to docker hub.", default=False)
81-
@click.option("--pre-install-command", type=str, help="Run the command before installing dependencies.", default=None)
81+
@click.option(
82+
"--pre-install-command",
83+
type=str,
84+
help="Run the command before installing dependencies.",
85+
default=None,
86+
)
8287
@image_author_option
8388
def build_image( # pylint: disable=too-many-arguments
8489
agent: Optional[PublicId],

autonomy/deploy/image.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,19 @@ def build_image( # pylint: disable=too-many-arguments,too-many-locals
100100
tag,
101101
"--no-cache",
102102
]
103-
+ (["--build-arg", f"EXTRA_DEPENDENCIES={generate_dependency_flag_var(extra_dependencies)}"] if extra_dependencies else [])
104-
+ (["--build-arg", f"PRE_INSTALL_COMMAND={pre_install_command}"] if pre_install_command else [])
103+
+ (
104+
[
105+
"--build-arg",
106+
f"EXTRA_DEPENDENCIES={generate_dependency_flag_var(extra_dependencies)}",
107+
]
108+
if extra_dependencies
109+
else []
110+
)
111+
+ (
112+
["--build-arg", f"PRE_INSTALL_COMMAND={pre_install_command}"]
113+
if pre_install_command
114+
else []
115+
)
105116
+ (["--platform", platform] if platform else [])
106117
+ (["--push"] if push else [])
107118
+ (["--pull"] if pull else [])

docs/api/cli/build_images.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Build images.
6161
is_flag=True,
6262
help="Push image to docker hub.",
6363
default=False)
64+
@click.option(
65+
"--pre-install-command",
66+
type=str,
67+
help="Run the command before installing dependencies.",
68+
default=None,
69+
)
6470
@image_author_option
6571
def build_image(agent: Optional[PublicId],
6672
service_dir: Optional[Path],
@@ -72,7 +78,8 @@ def build_image(agent: Optional[PublicId],
7278
image_author: Optional[str] = None,
7379
platform: Optional[str] = None,
7480
push: bool = False,
75-
builder: Optional[str] = None) -> None
81+
builder: Optional[str] = None,
82+
pre_install_command: Optional[str] = None) -> None
7683
```
7784

7885
Build runtime images for autonomous agents.

docs/api/cli/helpers/image.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def build_image(agent: Optional[PublicId],
1818
dockerfile: Optional[Path] = None,
1919
platform: Optional[str] = None,
2020
push: bool = False,
21-
builder: Optional[str] = None) -> None
21+
builder: Optional[str] = None,
22+
pre_install_command: Optional[str] = None) -> None
2223
```
2324

2425
Build agent/service image.

docs/api/deploy/image.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def build_image(agent: PublicId,
3737
dockerfile: Optional[Path] = None,
3838
platform: Optional[str] = None,
3939
push: bool = False,
40-
builder: Optional[str] = None) -> None
40+
builder: Optional[str] = None,
41+
pre_install_command: Optional[str] = None) -> None
4142
```
4243

4344
Command to build images from for skaffold deployment.

0 commit comments

Comments
 (0)