bakefile 0.0.4__py3-none-any.whl → 0.0.9__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.
Files changed (78) hide show
  1. bake/__init__.py +9 -0
  2. bake/bakebook/bakebook.py +85 -0
  3. bake/bakebook/decorator.py +50 -0
  4. bake/bakebook/get.py +175 -0
  5. bake/cli/bake/__init__.py +3 -0
  6. bake/cli/bake/__main__.py +5 -0
  7. bake/cli/bake/main.py +74 -0
  8. bake/cli/bake/reinvocation.py +63 -0
  9. bake/cli/bakefile/__init__.py +3 -0
  10. bake/cli/bakefile/__main__.py +5 -0
  11. bake/cli/bakefile/add_inline.py +29 -0
  12. bake/cli/bakefile/export.py +212 -0
  13. bake/cli/bakefile/find_python.py +18 -0
  14. bake/cli/bakefile/init.py +56 -0
  15. bake/cli/bakefile/lint.py +77 -0
  16. bake/cli/bakefile/main.py +43 -0
  17. bake/cli/bakefile/uv.py +146 -0
  18. bake/cli/common/app.py +54 -0
  19. bake/cli/common/callback.py +13 -0
  20. bake/cli/common/context.py +145 -0
  21. bake/cli/common/exception_handler.py +57 -0
  22. bake/cli/common/obj.py +216 -0
  23. bake/cli/common/params.py +72 -0
  24. bake/cli/utils/__init__.py +0 -0
  25. bake/cli/utils/version.py +18 -0
  26. bake/manage/__init__.py +0 -0
  27. bake/manage/add_inline.py +71 -0
  28. bake/manage/find_python.py +210 -0
  29. bake/manage/lint.py +101 -0
  30. bake/manage/run_uv.py +88 -0
  31. bake/manage/write_bakefile.py +20 -0
  32. bake/py.typed +0 -0
  33. bake/samples/__init__.py +0 -0
  34. bake/samples/simple.py +8 -0
  35. bake/ui/__init__.py +11 -0
  36. bake/ui/console.py +58 -0
  37. bake/ui/logger/__init__.py +33 -0
  38. bake/ui/logger/capsys.py +158 -0
  39. bake/ui/logger/setup.py +53 -0
  40. bake/ui/logger/utils.py +215 -0
  41. bake/ui/params.py +5 -0
  42. bake/ui/run/__init__.py +5 -0
  43. bake/ui/run/run.py +546 -0
  44. bake/ui/run/script.py +74 -0
  45. bake/ui/run/splitter.py +257 -0
  46. bake/ui/run/uv.py +83 -0
  47. bake/ui/style.py +2 -0
  48. bake/utils/__init__.py +11 -0
  49. bake/utils/constants.py +21 -0
  50. {bakefile → bake/utils}/env.py +3 -1
  51. bake/utils/exceptions.py +17 -0
  52. {bakefile-0.0.4.dist-info → bakefile-0.0.9.dist-info}/METADATA +16 -2
  53. bakefile-0.0.9.dist-info/RECORD +68 -0
  54. {bakefile-0.0.4.dist-info → bakefile-0.0.9.dist-info}/WHEEL +2 -2
  55. bakefile-0.0.9.dist-info/entry_points.txt +5 -0
  56. bakelib/__init__.py +23 -0
  57. bakelib/environ/__init__.py +14 -0
  58. bakelib/environ/bakebook.py +30 -0
  59. bakelib/environ/base.py +112 -0
  60. bakelib/environ/get_bakebook.py +49 -0
  61. bakelib/environ/presets.py +70 -0
  62. bakelib/space/__init__.py +0 -0
  63. bakelib/space/base.py +193 -0
  64. bakelib/space/python.py +89 -0
  65. bakelib/space/utils.py +118 -0
  66. bakefile/__init__.py +0 -13
  67. bakefile/cli/bake/__init__.py +0 -3
  68. bakefile/cli/bake/main.py +0 -127
  69. bakefile/cli/bake/resolve_bakebook.py +0 -103
  70. bakefile/cli/bake/utils.py +0 -25
  71. bakefile/cli/bakefile.py +0 -19
  72. bakefile/cli/utils/version.py +0 -9
  73. bakefile/exceptions.py +0 -9
  74. bakefile-0.0.4.dist-info/RECORD +0 -16
  75. bakefile-0.0.4.dist-info/entry_points.txt +0 -4
  76. {bakefile/cli/utils → bake/bakebook}/__init__.py +0 -0
  77. {bakefile → bake}/cli/__init__.py +0 -0
  78. /bakefile/py.typed → /bake/cli/common/__init__.py +0 -0
@@ -0,0 +1,257 @@
1
+ import errno
2
+ import os
3
+ import select
4
+ import subprocess
5
+ import sys
6
+ import threading
7
+ import time
8
+
9
+ # No PTY locks needed - each thread reads from its own PTY fd independently
10
+ # Locks were causing race conditions where threads waited while their process exited
11
+
12
+
13
+ class OutputSplitter:
14
+ def __init__(
15
+ self,
16
+ stream: bool = True,
17
+ capture: bool = True,
18
+ pty_fd: int | None = None,
19
+ stderr_pty_fd: int | None = None,
20
+ encoding: str | None = None,
21
+ ):
22
+ self._stream = stream
23
+ self._capture = capture
24
+ self._pty_fd = pty_fd
25
+ self._stderr_pty_fd = stderr_pty_fd
26
+ self._encoding = encoding
27
+ self._stdout_data = b""
28
+ self._stderr_data = b""
29
+
30
+ def _read_stream(self, stream, target, output_list):
31
+ for line in iter(stream.readline, b""):
32
+ if self._stream:
33
+ target.buffer.write(line)
34
+ target.buffer.flush()
35
+ if self._capture:
36
+ output_list.append(line)
37
+ stream.close()
38
+
39
+ def _handle_data(self, data: bytes, target, output_list) -> bool:
40
+ """Handle data chunk: return False if data is empty (EOF)."""
41
+ if not data:
42
+ return False
43
+ if self._stream:
44
+ target.buffer.write(data)
45
+ target.buffer.flush()
46
+ if self._capture:
47
+ output_list.append(data)
48
+ return True
49
+
50
+ def _read_pty(self, pty_fd: int, target, output_list, proc: subprocess.Popen):
51
+ """Read from PTY file descriptor in chunks and stream to output."""
52
+ import fcntl
53
+
54
+ try:
55
+ while True:
56
+ # Try immediate non-blocking read first (catches fast-exiting processes)
57
+ try:
58
+ # Set non-blocking mode
59
+ flags = fcntl.fcntl(pty_fd, fcntl.F_GETFL)
60
+ fcntl.fcntl(pty_fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
61
+
62
+ data = os.read(pty_fd, 4096)
63
+ if not self._handle_data(data, target, output_list):
64
+ break
65
+
66
+ # Restore blocking mode
67
+ fcntl.fcntl(pty_fd, fcntl.F_SETFL, flags)
68
+ except BlockingIOError:
69
+ # No data available yet, restore blocking mode and wait with select
70
+ fcntl.fcntl(pty_fd, fcntl.F_SETFL, flags)
71
+
72
+ # Wait for data to be available
73
+ ready, _, _ = select.select([pty_fd], [], [], 0.1)
74
+
75
+ if ready:
76
+ try:
77
+ data = os.read(pty_fd, 4096)
78
+ except OSError as e:
79
+ # EIO (errno 5) means PTY slave closed - treat as EOF
80
+ # This can happen in CI environments when process exits
81
+ if e.errno == errno.EIO:
82
+ break
83
+ raise
84
+ if not self._handle_data(data, target, output_list):
85
+ break
86
+
87
+ # Check if process exited after reading data
88
+ if proc.poll() is not None:
89
+ self._drain_pty(pty_fd, target, output_list)
90
+ break
91
+ finally:
92
+ os.close(pty_fd)
93
+
94
+ def _read_pty_data(self, pty_fd: int, target, output_list) -> bool:
95
+ """Read and handle available PTY data. Returns False on EOF/error."""
96
+ try:
97
+ data = os.read(pty_fd, 4096)
98
+ return self._handle_data(data, target, output_list)
99
+ except OSError:
100
+ return False
101
+
102
+ def _try_select_read(self, pty_fd: int, timeout: float) -> tuple[bool, bool]:
103
+ """Try to read using select.select().
104
+
105
+ Returns:
106
+ (success, has_data): success if select worked, has_data if ready
107
+ """
108
+ try:
109
+ ready, _, _ = select.select([pty_fd], [], [], timeout)
110
+ return True, bool(ready)
111
+ except OSError:
112
+ # On Windows, select.select() raises OSError for non-socket file descriptors
113
+ return False, False
114
+
115
+ def _read_and_handle(self, pty_fd: int, target, output_list) -> bool:
116
+ """Read from PTY and handle data.
117
+
118
+ Returns:
119
+ True if data was handled, False if EOF/error
120
+ """
121
+ try:
122
+ data = os.read(pty_fd, 4096)
123
+ return self._handle_data(data, target, output_list)
124
+ except OSError:
125
+ return False
126
+
127
+ def _handle_data_ready(self, pty_fd: int, target, output_list) -> bool:
128
+ """Handle data ready from select.
129
+
130
+ Returns:
131
+ True if should continue draining, False if done
132
+ """
133
+ return self._read_and_handle(pty_fd, target, output_list)
134
+
135
+ def _handle_timeout(
136
+ self,
137
+ pty_fd: int,
138
+ target,
139
+ output_list,
140
+ select_works: bool,
141
+ consecutive_timeouts: int,
142
+ ) -> tuple[bool, int]:
143
+ """Handle timeout when no data ready.
144
+
145
+ Returns:
146
+ (should_continue, new_timeout_count)
147
+ """
148
+ # Try direct read after 2 consecutive timeouts or if select doesn't work
149
+ if not select_works or consecutive_timeouts >= 2:
150
+ if not self._read_and_handle(pty_fd, target, output_list):
151
+ return False, 0
152
+ return True, 0 # Got data, reset timeout counter
153
+ return True, consecutive_timeouts + 1
154
+
155
+ def _drain_pty(self, pty_fd: int, target, output_list):
156
+ """Drain remaining data from PTY after process exits.
157
+
158
+ We need to handle OS timing: proc.poll() may return exit code before the
159
+ PTY buffer is fully flushed. We use select to wait for data with increasing
160
+ timeouts, and also try direct reads as a fallback in case select doesn't
161
+ detect readiness (e.g., in tests with mocked os.read or on Windows with
162
+ non-socket file descriptors).
163
+ """
164
+ time.sleep(0.005)
165
+
166
+ timeout = 0.05
167
+ consecutive_timeouts = 0
168
+ max_timeouts = 4
169
+ select_works = True
170
+
171
+ try:
172
+ while consecutive_timeouts < max_timeouts:
173
+ # Check if data is ready via select
174
+ if select_works:
175
+ select_works, ready = self._try_select_read(pty_fd, timeout)
176
+ else:
177
+ ready = False
178
+
179
+ if ready:
180
+ # Data ready - read and handle
181
+ if not self._handle_data_ready(pty_fd, target, output_list):
182
+ return
183
+ consecutive_timeouts = 0
184
+ timeout = 0.02
185
+ continue
186
+
187
+ # No data ready - increment timeout and try direct read
188
+ timeout = min(timeout * 1.5, 0.2)
189
+
190
+ should_continue, consecutive_timeouts = self._handle_timeout(
191
+ pty_fd, target, output_list, select_works, consecutive_timeouts
192
+ )
193
+ if not should_continue:
194
+ return
195
+ except OSError:
196
+ pass
197
+
198
+ def attach(self, proc: subprocess.Popen):
199
+ threads = []
200
+
201
+ # Handle PTY stdout (for color-preserving output on Unix)
202
+ if self._pty_fd is not None:
203
+ stdout_list = []
204
+ t = threading.Thread(
205
+ target=self._read_pty, args=(self._pty_fd, sys.stdout, stdout_list, proc)
206
+ )
207
+ t.daemon = True
208
+ t.start()
209
+ threads.append((t, stdout_list, "stdout"))
210
+
211
+ # Handle regular stdout
212
+ elif proc.stdout:
213
+ stdout_list = []
214
+ t = threading.Thread(
215
+ target=self._read_stream, args=(proc.stdout, sys.stdout, stdout_list)
216
+ )
217
+ t.daemon = True
218
+ t.start()
219
+ threads.append((t, stdout_list, "stdout"))
220
+
221
+ # Handle PTY stderr (for color-preserving stderr on Unix)
222
+ if self._stderr_pty_fd is not None:
223
+ stderr_list = []
224
+ t = threading.Thread(
225
+ target=self._read_pty, args=(self._stderr_pty_fd, sys.stderr, stderr_list, proc)
226
+ )
227
+ t.daemon = True
228
+ t.start()
229
+ threads.append((t, stderr_list, "stderr"))
230
+
231
+ # Handle stderr (regular pipe) - use separate if, not elif
232
+ if proc.stderr:
233
+ stderr_list = []
234
+ t = threading.Thread(
235
+ target=self._read_stream, args=(proc.stderr, sys.stderr, stderr_list)
236
+ )
237
+ t.daemon = True
238
+ t.start()
239
+ threads.append((t, stderr_list, "stderr"))
240
+
241
+ return threads
242
+
243
+ def finalize(self, threads):
244
+ for t, data_list, name in threads:
245
+ t.join()
246
+ if name == "stdout":
247
+ self._stdout_data = b"".join(data_list)
248
+ else:
249
+ self._stderr_data = b"".join(data_list)
250
+
251
+ @property
252
+ def stdout(self) -> bytes:
253
+ return self._stdout_data
254
+
255
+ @property
256
+ def stderr(self) -> bytes:
257
+ return self._stderr_data
bake/ui/run/uv.py ADDED
@@ -0,0 +1,83 @@
1
+ import subprocess
2
+ from pathlib import Path
3
+ from typing import Literal, overload
4
+
5
+ from uv import find_uv_bin
6
+
7
+ from bake.ui import console
8
+ from bake.ui.run.run import run
9
+
10
+
11
+ @overload
12
+ def run_uv(
13
+ cmd: list[str] | tuple[str, ...],
14
+ *,
15
+ capture_output: Literal[True] = True,
16
+ check: bool = True,
17
+ cwd: Path | str | None = None,
18
+ stream: bool = False,
19
+ shell: bool | None = None,
20
+ echo: bool = True,
21
+ dry_run: bool = False,
22
+ keep_temp_file: bool = False,
23
+ env: dict[str, str] | None = None,
24
+ _encoding: str | None = None,
25
+ **kwargs,
26
+ ) -> subprocess.CompletedProcess[str]: ...
27
+
28
+
29
+ @overload
30
+ def run_uv(
31
+ cmd: list[str] | tuple[str, ...],
32
+ *,
33
+ capture_output: Literal[False],
34
+ check: bool = True,
35
+ cwd: Path | str | None = None,
36
+ stream: bool = False,
37
+ echo: bool = True,
38
+ dry_run: bool = False,
39
+ keep_temp_file: bool = False,
40
+ env: dict[str, str] | None = None,
41
+ _encoding: str | None = None,
42
+ **kwargs,
43
+ ) -> subprocess.CompletedProcess[None]: ...
44
+
45
+
46
+ def run_uv(
47
+ cmd: list[str] | tuple[str, ...],
48
+ *,
49
+ capture_output: bool = True,
50
+ check: bool = True,
51
+ cwd: Path | str | None = None,
52
+ stream: bool = False,
53
+ echo: bool = True,
54
+ dry_run: bool = False,
55
+ keep_temp_file: bool = False,
56
+ env: dict[str, str] | None = None,
57
+ _encoding: str | None = None,
58
+ **kwargs,
59
+ ) -> subprocess.CompletedProcess[str] | subprocess.CompletedProcess[None]:
60
+ uv_bin = find_uv_bin()
61
+
62
+ # Build display string: "uv" + command parts (no full binary path)
63
+ display_cmd = "uv " + " ".join(cmd)
64
+
65
+ # Echo command to console if requested
66
+ if echo:
67
+ console.cmd(display_cmd)
68
+
69
+ # Call run with full uv binary path, echo=False (already displayed), pass through options
70
+ return run(
71
+ [uv_bin, *cmd],
72
+ capture_output=capture_output,
73
+ check=check,
74
+ cwd=cwd,
75
+ stream=stream,
76
+ shell=False,
77
+ echo=False,
78
+ dry_run=dry_run,
79
+ keep_temp_file=keep_temp_file,
80
+ env=env,
81
+ _encoding=_encoding,
82
+ **kwargs,
83
+ )
bake/ui/style.py ADDED
@@ -0,0 +1,2 @@
1
+ def code(message: str) -> str:
2
+ return f"`[cyan]{message}[/cyan]`"
bake/utils/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ from bake.utils.constants import DEFAULT_BAKEBOOK_NAME, DEFAULT_FILE_NAME
2
+ from bake.utils.env import should_use_colors
3
+ from bake.utils.exceptions import BakebookError, BaseBakefileError
4
+
5
+ __all__ = [
6
+ "DEFAULT_BAKEBOOK_NAME",
7
+ "DEFAULT_FILE_NAME",
8
+ "BakebookError",
9
+ "BaseBakefileError",
10
+ "should_use_colors",
11
+ ]
@@ -0,0 +1,21 @@
1
+ from pathlib import Path
2
+
3
+ # Default value
4
+ DEFAULT_CHDIR = Path(".")
5
+ DEFAULT_FILE_NAME = "bakefile.py"
6
+ DEFAULT_BAKEBOOK_NAME = "bakebook"
7
+ DEFAULT_IS_CHAIN_COMMAND = False
8
+
9
+ # CLI command names
10
+ CMD_BAKE = "bake"
11
+ CMD_BAKEFILE = "bakefile"
12
+ CMD_INIT = "init"
13
+ CMD_ADD_INLINE = "add-inline"
14
+ CMD_LINT = "lint"
15
+
16
+ # Bakefile app command name
17
+ GET_BAKEFILE_OBJECT = "get_bakefile_object"
18
+
19
+ # Others
20
+ BAKEBOOK_NAME_IN_SAMPLES = "__bakebook__"
21
+ BAKE_COMMAND_KWARGS = "_bake_command_kwargs"
@@ -2,7 +2,9 @@ import os
2
2
 
3
3
  ENV_NO_COLOR = "NO_COLOR"
4
4
 
5
+ _BAKE_REINVOKED = "_BAKE_REINVOKED"
6
+
5
7
 
6
8
  def should_use_colors() -> bool:
7
9
  value = os.environ.get(ENV_NO_COLOR)
8
- return not (value == "" or value is None)
10
+ return value == "" or value is None
@@ -0,0 +1,17 @@
1
+ """Custom exceptions for bakefile."""
2
+
3
+
4
+ class BaseBakefileError(Exception):
5
+ """Base exception for all bakefile errors."""
6
+
7
+
8
+ class BakebookError(BaseBakefileError):
9
+ """Exception raised when bakebook cannot be loaded or validated (unexpected error)."""
10
+
11
+
12
+ class BakefileNotFoundError(BakebookError):
13
+ """Exception raised when bakefile.py is not found (expected/suppressable error)."""
14
+
15
+
16
+ class PythonNotFoundError(BaseBakefileError):
17
+ """Exception raised when Python executable cannot be found or created."""
@@ -1,12 +1,26 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bakefile
3
- Version: 0.0.4
3
+ Version: 0.0.9
4
4
  Summary: Add your description here
5
5
  Author: Wisaroot Lertthaweedech
6
6
  Author-email: Wisaroot Lertthaweedech <l.wisaroot@gmail.com>
7
+ Requires-Dist: beautysh>=6.4.2
8
+ Requires-Dist: click>=8.3.1
9
+ Requires-Dist: loguru>=0.7.3
10
+ Requires-Dist: orjson>=3.11.5
11
+ Requires-Dist: pydantic-settings>=2.0.0
7
12
  Requires-Dist: pydantic>=2.12.5
8
- Requires-Dist: typer>=0.0.1
13
+ Requires-Dist: python-dotenv>=1.2.1
14
+ Requires-Dist: pyyaml>=6.0.3
15
+ Requires-Dist: rich>=14.2.0
16
+ Requires-Dist: ruff>=0.14.10
17
+ Requires-Dist: tomli>=2.0.0 ; python_full_version < '3.11'
18
+ Requires-Dist: ty>=0.0.8
19
+ Requires-Dist: typer>=0.21.0
20
+ Requires-Dist: uv>=0.9.20
21
+ Requires-Dist: pathspec>=1.0.3 ; extra == 'lib'
9
22
  Requires-Python: >=3.10
23
+ Provides-Extra: lib
10
24
  Description-Content-Type: text/markdown
11
25
 
12
26
  [![tests](https://img.shields.io/github/actions/workflow/status/wislertt/bakefile/cd.yml?branch=main&label=tests&logo=github)](https://github.com/wislertt/bakefile/actions/workflows/cd.yml)
@@ -0,0 +1,68 @@
1
+ bake/__init__.py,sha256=ikK9AMD9ELxzcH3_JRZt3bnNLS0vCzlaH82gpGi_dNE,356
2
+ bake/bakebook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ bake/bakebook/bakebook.py,sha256=o1sp8Wewxdqr7k12qT-Q4ZrKQ7c7jDliiNCYrVG93NA,2939
4
+ bake/bakebook/decorator.py,sha256=t2I6Pf1vdTk7k8lTzZCqq71-hzcXFvFYbuFV_Wvg45Q,1545
5
+ bake/bakebook/get.py,sha256=fx5WV66OIBrywPN0thePXAJk2gt7wvTVAxYQqZ_PMao,5807
6
+ bake/cli/__init__.py,sha256=da1PTClDMl-IBkrSvq6JC1lnS-K_BASzCvxVhNxN5Ls,13
7
+ bake/cli/bake/__init__.py,sha256=CJokSP1t1KXaIqjkjFQ8_gbaSZ9RRB4YdemIoSTqRcI,56
8
+ bake/cli/bake/__main__.py,sha256=5Ui5_OD1-oG1ou6boak63EPQDmRsW9sGOVVDgXJaNec,133
9
+ bake/cli/bake/main.py,sha256=Lr6eyfaf4-zDRrF0GK9bjjFWop66ydewV5tNUluDd9M,2262
10
+ bake/cli/bake/reinvocation.py,sha256=Ifqc8ZAM7NMyrKU2jkmw1agCEI-Sx7yvLLBiFRi23_0,1985
11
+ bake/cli/bakefile/__init__.py,sha256=_zD3rXQHLr6EWHADdPLAmnc2A5C3dhmBuvP5uJ-_A58,60
12
+ bake/cli/bakefile/__main__.py,sha256=FVntzkZdzdygSWjMzyneXCXsM-MDTPmC3GUk4JZiYFU,137
13
+ bake/cli/bakefile/add_inline.py,sha256=V98T50SLMPqnWVtyEO_6hL17r4n3ZtkSC8NSEqdyHzc,919
14
+ bake/cli/bakefile/export.py,sha256=m9X0u6FgbjUzneQuh39H1CaFUT444jOPTFBNjnjs_Dg,6326
15
+ bake/cli/bakefile/find_python.py,sha256=J2HDs_nfNODqCHBZCNM64ESB4kVZK-C04i-KNmVUoSs,539
16
+ bake/cli/bakefile/init.py,sha256=0QuvADFOZZUBN2BUJfK90aEY1oUzoSNVRiljlUSjLu0,1825
17
+ bake/cli/bakefile/lint.py,sha256=DJkIJNBOef6JvgwQ3iL9jTrLqgUyn66Mhv6cuAgqXk0,2509
18
+ bake/cli/bakefile/main.py,sha256=jbpzNQa55thbzhpcmEtys1M1CvNUJBvi5UmgVzSbOM8,1414
19
+ bake/cli/bakefile/uv.py,sha256=PMFG3BdofzGWkor4fMEi3GE4G7hGtclCgPm2xlaPDso,4013
20
+ bake/cli/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ bake/cli/common/app.py,sha256=_XzBOy0OK2GB14E-cyfLV6CBCn70G62QqjUscj_DHfA,1443
22
+ bake/cli/common/callback.py,sha256=NmrZUl5eRr95nluomTwcKjTU7dSKjWcQVli5VEdZk-4,439
23
+ bake/cli/common/context.py,sha256=RtFHUDCZLcD88Ys17u_zXoHUq-12jkoXc9f_D4jh_7M,3871
24
+ bake/cli/common/exception_handler.py,sha256=2vLbqMeZlLxKqNWUkTs3cA-8l6IjK0dU3SyZlRb96YI,1759
25
+ bake/cli/common/obj.py,sha256=ShDsQtHCxex17IrKb9kSdC1t459qBsam53SFCUB_DSA,7094
26
+ bake/cli/common/params.py,sha256=rhLa34SY92nXfUaKo0SQMKK__xRnrmHejHa25tRyKdg,2002
27
+ bake/cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
+ bake/cli/utils/version.py,sha256=aiweLD0vDezBlJAcCC99oMms71WGD9CWSJuZ4i3VLHA,390
29
+ bake/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ bake/manage/add_inline.py,sha256=yefHmF33ghCB8NZ-v61ybeVsaeE8iDFvfRGeTAKg4I8,2245
31
+ bake/manage/find_python.py,sha256=oVmd8KaSsgDQWHuGZpYiQx-DHn50P9EkRi6-YIad99E,7165
32
+ bake/manage/lint.py,sha256=OqwYFF8GGvzHGVPuJcWMRAv5esXEIX4nQXdGcChnkqA,2394
33
+ bake/manage/run_uv.py,sha256=QzlKeVpr20dXNDcwUgyJqnXT4MofRqK-6XkWpzBbUhE,3234
34
+ bake/manage/write_bakefile.py,sha256=efGViLk7sh-QX9Mox7yQw_A1Tp7EOuc_vmSTbFmXUm0,736
35
+ bake/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ bake/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ bake/samples/simple.py,sha256=hP2TW-D7BQBGJseqRPpilxkoQ8ScTuZZePICupyvFKA,155
38
+ bake/ui/__init__.py,sha256=6OhZVKjfC9aumbhraxkGtx7KLpV1ouepeHRA2dUVoSo,209
39
+ bake/ui/console.py,sha256=C5wrbsOc-wwcx0hGmCozHvGCNTWgGhsh-5vxl880xS4,1689
40
+ bake/ui/logger/__init__.py,sha256=bup2cssTHhergh47s6uYbGtY2dJNxlKKH6otBc4ECFM,728
41
+ bake/ui/logger/capsys.py,sha256=KZL6k7Werp_8styfJKfIvQyv0-gJq54vY3hSJFIacEM,5267
42
+ bake/ui/logger/setup.py,sha256=OrX9UiY0iBGfWWfhMJCdfqCRJsL5yC3rIdIEOn7rveo,1377
43
+ bake/ui/logger/utils.py,sha256=dcppxoS_pX92AFcHIerJGI2_JBHBNghRQmQqlZmmj2Q,7218
44
+ bake/ui/params.py,sha256=yNDChJQkbeZSxQzXTSBrAPCbwsJ5zOK4s4sFHQPSnHs,140
45
+ bake/ui/run/__init__.py,sha256=A671l5YVTRAtS47ewvaMCNwPRim_Wkof1am0WibxA2I,205
46
+ bake/ui/run/run.py,sha256=qfDgy-YqcexJyHhSjnQ5IXipBDoK-umwKq-wAn8ZITU,17504
47
+ bake/ui/run/script.py,sha256=fk7KiDklYDYpFGkH3wu-hZGI4OnvgcB8z5jtNt41Hg0,2263
48
+ bake/ui/run/splitter.py,sha256=uS9v822aGkeA0mLu_OmVA2I0rgoLSvkoITMfCM75tVs,9025
49
+ bake/ui/run/uv.py,sha256=3NpnjgAwQNijJiUT_H6U-3mTHQgBZPlJbNWEeYCZY1g,2077
50
+ bake/ui/style.py,sha256=v9dferzV317Acb0GHpVK_niCj_s2HtL-yiToBZtXky4,70
51
+ bake/utils/__init__.py,sha256=GUu_xlJy3RAHo6UcZXu2x4khxGqLHMA9Zos4hDiQIY8,326
52
+ bake/utils/constants.py,sha256=mRq5IpgOTdlHOTWPq5dx0A-LwhiFkWgYHfr8cLWG7rY,471
53
+ bake/utils/env.py,sha256=bzNdH_2bTJebQaw7D0uVJv-vzZ-uYl0pCAS8oQONVsA,190
54
+ bake/utils/exceptions.py,sha256=pwsQnKH5ljMNxmqEREutXa7TohiBHATHg_D5kQUPT30,519
55
+ bakelib/__init__.py,sha256=7lWfLpL82AVkot3BXodJpyuEzEAiythFevMtzxzd_i4,455
56
+ bakelib/environ/__init__.py,sha256=XIFVtu8SQySjPetu9WR_Q8HgqxUzenMNm1K24pYSfNo,356
57
+ bakelib/environ/bakebook.py,sha256=gnOvi3t5Ww0_6N5wozXLVvLe8KAK-u-6_v0UYCl_iKY,749
58
+ bakelib/environ/base.py,sha256=azPUdc9C5zVU8iyXJrEm3uDfe39nG48DRAZiF9rTdHI,3753
59
+ bakelib/environ/get_bakebook.py,sha256=LihxB3VDcVq81KJy1HT-N-beyt2C7ReWm2kMPrd7VlA,1563
60
+ bakelib/environ/presets.py,sha256=IwHGeDeQe4e57k9_u_vBQ61bjMS5Z2Jj9zkXw6YJHAE,1943
61
+ bakelib/space/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
+ bakelib/space/base.py,sha256=bJlpPkP85xBu8X5fJoVaHrMzX27rQrYTEPSObwBANJ8,6008
63
+ bakelib/space/python.py,sha256=0qxjIQ1SYIvDkaeQjkykE2t8doBUTl1MONK8cuG5juo,2793
64
+ bakelib/space/utils.py,sha256=xx4X_txhDH_p97CKJ-KuvFpgfNBC0y_din1IBlUVusU,2983
65
+ bakefile-0.0.9.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
66
+ bakefile-0.0.9.dist-info/entry_points.txt,sha256=Ecvvh7BYHCPJ0UdntrDc3Od6AZdRPXN5Z7o_7ok_0Qw,107
67
+ bakefile-0.0.9.dist-info/METADATA,sha256=ed15p6Yb_Bx_nnsu2rxVCsL7_AfSbu3Plr2-XHiKIIU,2367
68
+ bakefile-0.0.9.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.18
2
+ Generator: uv 0.9.26
3
3
  Root-Is-Purelib: true
4
- Tag: py3-none-any
4
+ Tag: py3-none-any
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ bake = bake.cli.bake:main
3
+ bakefile = bake.cli.bakefile:main
4
+ bf = bake.cli.bakefile:main
5
+
bakelib/__init__.py ADDED
@@ -0,0 +1,23 @@
1
+ from bakelib.environ import (
2
+ BaseEnv,
3
+ DevEnvBakebook,
4
+ EnvBakebook,
5
+ GcpLandingZoneEnv,
6
+ ProdEnvBakebook,
7
+ StagingEnvBakebook,
8
+ get_bakebook,
9
+ )
10
+ from bakelib.space.base import BaseSpace
11
+ from bakelib.space.python import PythonSpace
12
+
13
+ __all__ = [
14
+ "BaseEnv",
15
+ "BaseSpace",
16
+ "DevEnvBakebook",
17
+ "EnvBakebook",
18
+ "GcpLandingZoneEnv",
19
+ "ProdEnvBakebook",
20
+ "PythonSpace",
21
+ "StagingEnvBakebook",
22
+ "get_bakebook",
23
+ ]
@@ -0,0 +1,14 @@
1
+ from .bakebook import DevEnvBakebook, EnvBakebook, ProdEnvBakebook, StagingEnvBakebook
2
+ from .base import BaseEnv
3
+ from .get_bakebook import get_bakebook
4
+ from .presets import GcpLandingZoneEnv
5
+
6
+ __all__ = [
7
+ "BaseEnv",
8
+ "DevEnvBakebook",
9
+ "EnvBakebook",
10
+ "GcpLandingZoneEnv",
11
+ "ProdEnvBakebook",
12
+ "StagingEnvBakebook",
13
+ "get_bakebook",
14
+ ]
@@ -0,0 +1,30 @@
1
+ from typing import Annotated
2
+
3
+ from pydantic import Field, computed_field
4
+
5
+ from bake.bakebook.bakebook import Bakebook
6
+ from bakelib.environ.base import BaseEnv
7
+
8
+ BaseEnvFieldType = Annotated[BaseEnv, Field(exclude=True, repr=False)]
9
+
10
+
11
+ class EnvBakebook(Bakebook):
12
+ # Field name uses underscore suffix to avoid Pydantic reading from ENV env var
13
+ env_: BaseEnvFieldType = Field(exclude=True, repr=False)
14
+
15
+ @computed_field
16
+ @property
17
+ def env(self) -> BaseEnv:
18
+ return self.env_
19
+
20
+
21
+ class DevEnvBakebook(EnvBakebook):
22
+ env_: BaseEnvFieldType = BaseEnv("dev")
23
+
24
+
25
+ class StagingEnvBakebook(EnvBakebook):
26
+ env_: BaseEnvFieldType = BaseEnv("staging")
27
+
28
+
29
+ class ProdEnvBakebook(EnvBakebook):
30
+ env_: BaseEnvFieldType = BaseEnv("prod")