docker-devkit 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,11 +5,11 @@ import os
5
5
  import platform
6
6
  import re
7
7
  from pathlib import Path
8
- from typing import Any, Literal
8
+ from typing import Annotated, Any, Literal
9
9
 
10
10
  import typer
11
11
  import yaml
12
- from bashrun import bash, bash_output
12
+ from bashrun.bash import bash, bash_output
13
13
  from .detect_gpu import GPU_TYPES, Gpu, detect_gpu
14
14
  from pydantic_settings import BaseSettings
15
15
 
@@ -103,18 +103,21 @@ def _load_compose(path: Path) -> dict[str, Any]:
103
103
  def build(
104
104
  upgrade: bool = typer.Option(False, "--upgrade", "-u", help="Re-resolve and rewrite base digests."),
105
105
  lock_only: bool = typer.Option(False, "--lock-only", help="Update lock file without building images."),
106
- mode: Mode = typer.Option("local", "--mode", help="local: --load images; ci: --push images + registry caches."),
107
- gpu: Gpu = typer.Option("auto", "--gpu", help="auto|cuda|rocm|none"),
106
+ mode: Annotated[
107
+ Mode, typer.Option("--mode", help="local: --load images; ci: --push images + registry caches.")
108
+ ] = "local",
109
+ gpu: Annotated[Gpu, typer.Option("--gpu", help="auto|cuda|rocm|none")] = "auto",
108
110
  gpu_only: bool = typer.Option(
109
111
  False, "--gpu-only", help="Build only the services suffixed for this gpu (requires a concrete --gpu)."
110
112
  ),
111
113
  no_cache: bool = typer.Option(False, "--no-cache", help="Force rebuild by disabling cache usage."),
112
- targets_opt: list[str] | None = typer.Option(
113
- None, "--targets", "-t", help="Build only these services (from the selected bake file)."
114
- ),
115
- bake_file: Path = typer.Option(
116
- DEFAULT_BAKE_FILE, "--bake-file", help="Bake file to load (e.g. compose.bake.yml or compose.zed.bake.yml)."
117
- ),
114
+ targets_opt: Annotated[
115
+ list[str] | None,
116
+ typer.Option("--targets", "-t", help="Build only these services (from the selected bake file)."),
117
+ ] = None,
118
+ bake_file: Annotated[
119
+ Path, typer.Option("--bake-file", help="Bake file to load (e.g. compose.bake.yml or compose.zed.bake.yml).")
120
+ ] = DEFAULT_BAKE_FILE,
118
121
  ) -> None:
119
122
  run_build(
120
123
  upgrade=upgrade,
@@ -1,7 +1,7 @@
1
1
  import shutil
2
2
  from typing import Literal, get_args
3
3
 
4
- from bashrun import bash_check
4
+ from bashrun.bash import bash_check
5
5
 
6
6
  Gpu = Literal["auto", "cuda", "rocm", "none"]
7
7
  GPU_TYPES = tuple(g for g in get_args(Gpu) if g not in ("auto", "none"))
docker_devkit/down.py CHANGED
@@ -1,8 +1,9 @@
1
1
  import os
2
2
  from pathlib import Path
3
+ from typing import Annotated
3
4
 
4
5
  import typer
5
- from bashrun import bash_handoff
6
+ from bashrun.bash import bash_handoff
6
7
  from .detect_gpu import Gpu, detect_gpu
7
8
 
8
9
  from .context_sha import compute_service_shas
@@ -23,16 +24,18 @@ app = typer.Typer(add_completion=False)
23
24
  @app.command()
24
25
  def down(
25
26
  volumes: bool = typer.Option(False, "--volumes", "-v", help="Remove named volumes."),
26
- gpu: Gpu = typer.Option("auto", "--gpu", help="auto|cuda|rocm|none"),
27
- compose_file: Path = typer.Option(
28
- Path("compose.yml"),
29
- "--compose-file",
30
- help=(
31
- "Base compose file. In a repo that authors its own stack (where compose.bake.yml lives) the default "
32
- "compose.yml tears down the native multi-file stack. A consumer stack is torn down as the single graph "
33
- "it was brought up as."
27
+ gpu: Annotated[Gpu, typer.Option("--gpu", help="auto|cuda|rocm|none")] = "auto",
28
+ compose_file: Annotated[
29
+ Path,
30
+ typer.Option(
31
+ "--compose-file",
32
+ help=(
33
+ "Base compose file. In a repo that authors its own stack (where compose.bake.yml lives) the default "
34
+ "compose.yml tears down the native multi-file stack. A consumer stack is torn down as the single graph "
35
+ "it was brought up as."
36
+ ),
34
37
  ),
35
- ),
38
+ ] = Path("compose.yml"),
36
39
  ) -> None:
37
40
  # Mirror up: native multi-file teardown only when compose.bake.yml is present and the
38
41
  # default compose.yml was requested. A consumer stack tears down its single graph.
@@ -9,7 +9,7 @@ from itertools import starmap
9
9
  from pathlib import Path
10
10
 
11
11
  import yaml
12
- from bashrun import bash_output
12
+ from bashrun.bash import bash_output
13
13
  from pydantic import BaseModel, ConfigDict, Field, RootModel
14
14
 
15
15
  BUILD_ARG_PATTERN = re.compile(r"\$\{[A-Za-z0-9_]+\}")
docker_devkit/up.py CHANGED
@@ -1,8 +1,9 @@
1
1
  import os
2
2
  from pathlib import Path
3
+ from typing import Annotated
3
4
 
4
5
  import typer
5
- from bashrun import bash_handoff
6
+ from bashrun.bash import bash_handoff
6
7
  from .detect_gpu import Gpu, detect_gpu
7
8
 
8
9
  from .build_docker import run_build
@@ -33,18 +34,20 @@ def up(
33
34
  build: bool = typer.Option(
34
35
  False, "--build", help="Build all images locally before bringing the stack up; skips pulling"
35
36
  ),
36
- gpu: Gpu = typer.Option("auto", "--gpu", help="auto|cuda|rocm|none"),
37
+ gpu: Annotated[Gpu, typer.Option("--gpu", help="auto|cuda|rocm|none")] = "auto",
37
38
  no_dev: bool = typer.Option(False, "--no-dev", help="Skip layering compose.dev.yml (production-shape bring-up)"),
38
- compose_file: Path = typer.Option(
39
- Path("compose.yml"),
40
- "--compose-file",
41
- help=(
42
- "Base compose file. In a repo that authors its own images (where compose.bake.yml lives) the default "
43
- "compose.yml triggers the native multi-file assembly. A consumer stack — a repo whose compose.yml "
44
- "OCI-pulls an already-baked upstream artifact and layers on top — is run as the complete graph with "
45
- "only --env-file .env."
39
+ compose_file: Annotated[
40
+ Path,
41
+ typer.Option(
42
+ "--compose-file",
43
+ help=(
44
+ "Base compose file. In a repo that authors its own images (where compose.bake.yml lives) the default "
45
+ "compose.yml triggers the native multi-file assembly. A consumer stack — a repo whose compose.yml "
46
+ "OCI-pulls an already-baked upstream artifact and layers on top — is run as the complete graph with "
47
+ "only --env-file .env."
48
+ ),
46
49
  ),
47
- ),
50
+ ] = Path("compose.yml"),
48
51
  ) -> None:
49
52
  # A repo that authors its own stack carries compose.bake.yml and builds its own images,
50
53
  # so the default compose.yml means the native multi-file stack (postgres + gpu + dev layers,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: docker-devkit
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Docker-stack lifecycle commands (up/down/build) with a native/consumer split
5
5
  License-File: LICENSE
6
6
  License-File: NOTICE
@@ -0,0 +1,15 @@
1
+ docker_devkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ docker_devkit/build_docker.py,sha256=NmAw8GXQ8xcakKWRepjtArKts738MRMTohzSIlyU2GI,11940
3
+ docker_devkit/context_sha.py,sha256=KWwJtIKfgKkogYoPL7_KEcKX8XG3i-P6_ReIOkB5wE4,3085
4
+ docker_devkit/detect_gpu.py,sha256=C4e3vixvSSJS6xQiMVWp2IdWSAgMr551KrBTuIrkTk4,456
5
+ docker_devkit/down.py,sha256=dHqMqvsufCqwBD__tO2DEpyD9mS2T9ReyuqIcqUQ38c,2768
6
+ docker_devkit/image_refs.py,sha256=CZ5ibvs2l01gqh-GwaLUYhiZ_cz2_bjBk9PlplGVlts,6441
7
+ docker_devkit/modes.py,sha256=-6mNyvu3G97PzJ2vsfnXr5LwQhjvhlDfd11u6rkhN6M,1510
8
+ docker_devkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ docker_devkit/up.py,sha256=HQH5WB0kZTST6wJHS1jjzOWAvT2bK0u_MozRieU-iJU,4185
10
+ docker_devkit-0.1.4.dist-info/METADATA,sha256=vrb3AtKlpjITS0_fSRVoj-8GOPUy0fKu3Wz6LVNs3zg,399
11
+ docker_devkit-0.1.4.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
12
+ docker_devkit-0.1.4.dist-info/entry_points.txt,sha256=0AJlYxdEuQ7w21s1y-07MJ4AU_aJBUfkVWrwrxCqaMI,113
13
+ docker_devkit-0.1.4.dist-info/licenses/LICENSE,sha256=RFhQPdSOiMTguUX7JSoIuTxA7HVzCbj_p8WU36HjUQQ,10947
14
+ docker_devkit-0.1.4.dist-info/licenses/NOTICE,sha256=jvglZza3GCdN7v4_TLuXUqX9C_uABlwAKUkcIeKwk_8,26
15
+ docker_devkit-0.1.4.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- docker_devkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- docker_devkit/build_docker.py,sha256=DHv2hbnUPENyZVbmyjW5AZoVmoL-VMNPakAD37CMS_g,11857
3
- docker_devkit/context_sha.py,sha256=KWwJtIKfgKkogYoPL7_KEcKX8XG3i-P6_ReIOkB5wE4,3085
4
- docker_devkit/detect_gpu.py,sha256=V7X-eu-q0HrJo_rFmviOor62tm1yKjR2PX2RLnv7JBw,451
5
- docker_devkit/down.py,sha256=IMl-sjsLfa53sETcss6mEiAGEUhNIo3jYvKHg-t3xqA,2669
6
- docker_devkit/image_refs.py,sha256=PxYDVLkP43Gmc2Qh-R5AnpwYqkaZFD-uvAE-hWpJlho,6436
7
- docker_devkit/modes.py,sha256=-6mNyvu3G97PzJ2vsfnXr5LwQhjvhlDfd11u6rkhN6M,1510
8
- docker_devkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- docker_devkit/up.py,sha256=_8oZY0DBCC4mroWPjFC6wPIW0raPPwUXFMRoCFU57Cs,4082
10
- docker_devkit-0.1.2.dist-info/METADATA,sha256=cL0qTV-32EElpdqlH-W_iTy0qhtcvpP53LBMP9R6ZRQ,399
11
- docker_devkit-0.1.2.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
12
- docker_devkit-0.1.2.dist-info/entry_points.txt,sha256=0AJlYxdEuQ7w21s1y-07MJ4AU_aJBUfkVWrwrxCqaMI,113
13
- docker_devkit-0.1.2.dist-info/licenses/LICENSE,sha256=RFhQPdSOiMTguUX7JSoIuTxA7HVzCbj_p8WU36HjUQQ,10947
14
- docker_devkit-0.1.2.dist-info/licenses/NOTICE,sha256=jvglZza3GCdN7v4_TLuXUqX9C_uABlwAKUkcIeKwk_8,26
15
- docker_devkit-0.1.2.dist-info/RECORD,,