bakefile 0.0.13__py3-none-any.whl → 0.0.14__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.
- bake/cli/common/params.py +1 -1
- bake/manage/lint.py +1 -1
- bakefile-0.0.14.dist-info/METADATA +543 -0
- {bakefile-0.0.13.dist-info → bakefile-0.0.14.dist-info}/RECORD +6 -6
- {bakefile-0.0.13.dist-info → bakefile-0.0.14.dist-info}/WHEEL +1 -1
- bakefile-0.0.13.dist-info/METADATA +0 -40
- {bakefile-0.0.13.dist-info → bakefile-0.0.14.dist-info}/entry_points.txt +0 -0
bake/cli/common/params.py
CHANGED
bake/manage/lint.py
CHANGED
|
@@ -88,7 +88,7 @@ def run_ty_check(
|
|
|
88
88
|
echo: bool = True,
|
|
89
89
|
) -> subprocess.CompletedProcess[str]:
|
|
90
90
|
ty_bin = find_ty_bin()
|
|
91
|
-
cmd = ["check", "--error-on-warning", "--python", str(python_path)]
|
|
91
|
+
cmd = ["check", "--error-on-warning", "--no-progress", "--python", str(python_path)]
|
|
92
92
|
if only_bakefile:
|
|
93
93
|
cmd.append(bakefile_path.name)
|
|
94
94
|
|
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: bakefile
|
|
3
|
+
Version: 0.0.14
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Wisaroot Lertthaweedech
|
|
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
|
|
12
|
+
Requires-Dist: pydantic>=2.12.5
|
|
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: keyring>=25.7.0 ; extra == 'lib'
|
|
22
|
+
Requires-Dist: pathspec>=1.0.3 ; extra == 'lib'
|
|
23
|
+
Requires-Dist: tenacity>=9.1.2 ; extra == 'lib'
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Provides-Extra: lib
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
[](https://github.com/wislertt/bakefile/actions/workflows/cd.yml)
|
|
29
|
+
[](https://github.com/wislertt/bakefile/actions/workflows/cd.yml)
|
|
30
|
+
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
31
|
+
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
32
|
+
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
33
|
+
[](https://codecov.io/gh/wislertt/bakefile)
|
|
34
|
+
[](https://pypi.python.org/pypi/bakefile)
|
|
35
|
+
[](https://pepy.tech/projects/bakefile)
|
|
36
|
+
[](https://github.com/wislertt/bakefile/)
|
|
37
|
+
|
|
38
|
+
# bakefile
|
|
39
|
+
|
|
40
|
+
An OOP task runner in Python. Like a Makefile, but with tasks as Python class methods—so you can inherit, compose, and reuse them across projects.
|
|
41
|
+
|
|
42
|
+
## Why bakefile?
|
|
43
|
+
|
|
44
|
+
- **Reusable** - Makefile/Justfile work well, but reusing tasks across projects is hard. bakefile uses OOP class methods—inherit, compose, and share them
|
|
45
|
+
- **Python** - Use Python instead of DSL syntax. Access the full ecosystem with Python's language features, tooling, and type safety (ruff/ty)—with subprocess support for normal CLI commands
|
|
46
|
+
- **Language-agnostic** - Write tasks in Python, run commands for any language (Go, Rust, JS, etc.)
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
Install via pip:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install bakefile
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or via uv:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
uv add bakefile # as a project dependency
|
|
60
|
+
uv tool install bakefile # as a global tool
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
Create a file named `bakefile.py`:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from bake import Bakebook, command, Context, console
|
|
69
|
+
|
|
70
|
+
class MyBakebook(Bakebook):
|
|
71
|
+
@command()
|
|
72
|
+
def build(self, ctx: Context) -> None:
|
|
73
|
+
console.echo("Building...")
|
|
74
|
+
# Add your build commands here
|
|
75
|
+
|
|
76
|
+
bakebook = MyBakebook()
|
|
77
|
+
|
|
78
|
+
@bakebook.command()
|
|
79
|
+
def hello(name: str = "world"):
|
|
80
|
+
console.echo(f"Hello {name}!")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Tip:** Or generate a bakefile automatically:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
bakefile init # Basic bakefile
|
|
87
|
+
bakefile init --inline # With PEP 723 standalone dependencies
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Run your tasks:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bake hello # Hello world!
|
|
94
|
+
bake hello --name Alice # Hello Alice!
|
|
95
|
+
bake build # Building...
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Core Concepts
|
|
99
|
+
|
|
100
|
+
### Two CLIs
|
|
101
|
+
|
|
102
|
+
bakefile provides two command-line tools:
|
|
103
|
+
|
|
104
|
+
- **`bake`** - Runs tasks from your `bakefile.py`
|
|
105
|
+
- **`bakefile`** - Manages your `bakefile.py` (init, add-inline, lint, find-python, export, sync, lock, add, pip)
|
|
106
|
+
|
|
107
|
+
Detailed CLI documentation in [Usage](#usage).
|
|
108
|
+
|
|
109
|
+
### Bakebook
|
|
110
|
+
|
|
111
|
+
A class in `bakefile.py` that holds your tasks:
|
|
112
|
+
|
|
113
|
+
- **Inherit and reuse** - Create base classes with common tasks, extend them across projects
|
|
114
|
+
- **Extends Pydantic's `BaseSettings`** - Define configuration as class attributes
|
|
115
|
+
- **Uses `@command()` decorator** - Same syntax as Typer for defining CLI commands
|
|
116
|
+
- **Provides `ctx.run()`** - Execute CLI commands (built on Python's subprocess) from your tasks
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from bake import Bakebook, command, Context, console
|
|
120
|
+
from pydantic import Field
|
|
121
|
+
from typing import Annotated
|
|
122
|
+
import typer
|
|
123
|
+
|
|
124
|
+
class MyBakebook(Bakebook):
|
|
125
|
+
# Pydantic configuration
|
|
126
|
+
api_url: str = Field(default="https://api.example.com", env="API_URL")
|
|
127
|
+
|
|
128
|
+
@command()
|
|
129
|
+
def fetch(self, ctx: Context) -> None:
|
|
130
|
+
# Run CLI commands
|
|
131
|
+
ctx.run(f"curl {self.api_url}")
|
|
132
|
+
|
|
133
|
+
bakebook = MyBakebook()
|
|
134
|
+
|
|
135
|
+
# Standalone functions also work
|
|
136
|
+
@bakebook.command()
|
|
137
|
+
def test(
|
|
138
|
+
ctx: Context,
|
|
139
|
+
verbose: Annotated[bool, typer.Option(False, "--verbose", "-v")] = False,
|
|
140
|
+
):
|
|
141
|
+
if verbose:
|
|
142
|
+
console.echo("Running tests...")
|
|
143
|
+
ctx.run("pytest")
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### PEP 723 Support
|
|
147
|
+
|
|
148
|
+
bakefile supports [PEP 723](https://peps.python.org/pep-0723/) inline script metadata—your `bakefile.py` can declare its own dependencies. Add PEP 723 metadata to an existing bakefile with `bakefile add-inline`:
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
# /// script
|
|
152
|
+
# requires-python = ">=3.14"
|
|
153
|
+
# dependencies = [
|
|
154
|
+
# "bakefile>=0.0.0",
|
|
155
|
+
# ]
|
|
156
|
+
# ///
|
|
157
|
+
|
|
158
|
+
from bake import Bakebook, command, console
|
|
159
|
+
|
|
160
|
+
bakebook = Bakebook()
|
|
161
|
+
|
|
162
|
+
@bakebook.command()
|
|
163
|
+
def hello():
|
|
164
|
+
console.echo("Hello from standalone bakefile!")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Use case:** Ideal for non-Python projects without `pyproject.toml`. For Python projects, add bakefile to your project's dependencies instead.
|
|
168
|
+
|
|
169
|
+
## Usage
|
|
170
|
+
|
|
171
|
+
### Bakebook API
|
|
172
|
+
|
|
173
|
+
#### Creating a Bakebook
|
|
174
|
+
|
|
175
|
+
**Tip:** Generate a bakefile automatically with `bakefile init` or `bakefile add-inline`.
|
|
176
|
+
|
|
177
|
+
Create a bakebook by inheriting from `Bakebook` or instantiating it:
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
from bake import Bakebook
|
|
181
|
+
|
|
182
|
+
bakebook = Bakebook()
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### @command Decorator
|
|
186
|
+
|
|
187
|
+
- **Pattern 1: Before instantiating** - Use `@command()` on class methods
|
|
188
|
+
- **Pattern 2: After instantiating** - Use `@bakebook.command()` on standalone functions
|
|
189
|
+
- **Accepts all Typer options** - `name`, `help`, `deprecated`, etc.
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from bake import Bakebook, command, Context, console
|
|
193
|
+
from typing import Annotated
|
|
194
|
+
import typer
|
|
195
|
+
|
|
196
|
+
# Pattern 1: On class
|
|
197
|
+
class MyBakebook(Bakebook):
|
|
198
|
+
@command()
|
|
199
|
+
def task1(self, ctx: Context) -> None:
|
|
200
|
+
console.echo("Task 1")
|
|
201
|
+
|
|
202
|
+
bakebook = MyBakebook()
|
|
203
|
+
|
|
204
|
+
# Pattern 2: On instance (with Typer options)
|
|
205
|
+
@bakebook.command(name="deploy", help="Deploy application")
|
|
206
|
+
def deploy(
|
|
207
|
+
env: Annotated[str, typer.Option("dev", help="Environment to deploy")],
|
|
208
|
+
):
|
|
209
|
+
console.echo(f"Deploying to {env}...")
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Context API
|
|
213
|
+
|
|
214
|
+
The `Context` object extends Typer's Context with command execution:
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
@bakebook.command()
|
|
218
|
+
def my_command(ctx: Context) -> None:
|
|
219
|
+
# Run a command
|
|
220
|
+
ctx.run("echo hello")
|
|
221
|
+
|
|
222
|
+
# Run with options
|
|
223
|
+
ctx.run(
|
|
224
|
+
"pytest",
|
|
225
|
+
capture_output=False, # Stream to terminal
|
|
226
|
+
check=True, # Raise on error
|
|
227
|
+
cwd="/tmp", # Working directory
|
|
228
|
+
env={"KEY": "value"}, # Environment variables
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
# Run a multi-line script
|
|
232
|
+
ctx.run_script(
|
|
233
|
+
title="Setup",
|
|
234
|
+
script="""
|
|
235
|
+
echo "Step 1"
|
|
236
|
+
echo "Step 2"
|
|
237
|
+
""",
|
|
238
|
+
)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Pydantic Settings
|
|
242
|
+
|
|
243
|
+
Bakebooks extend Pydantic's `BaseSettings` for configuration:
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
from bake import Bakebook
|
|
247
|
+
from pydantic import Field
|
|
248
|
+
|
|
249
|
+
class MyBakebook(Bakebook):
|
|
250
|
+
# Defaults
|
|
251
|
+
database_url: str = "sqlite:///db.sqlite3"
|
|
252
|
+
|
|
253
|
+
# With environment variable mapping
|
|
254
|
+
api_key: str = Field(default="default-key", env="API_KEY")
|
|
255
|
+
|
|
256
|
+
# With validation
|
|
257
|
+
port: int = Field(default=8000, ge=1, le=65535)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Settings are loaded from environment variables, `.env` files, or defaults.
|
|
261
|
+
|
|
262
|
+
### `bake` CLI - Running Tasks
|
|
263
|
+
|
|
264
|
+
The `bake` command runs tasks from your `bakefile.py`. Run `bake --help` to see all available commands and options.
|
|
265
|
+
|
|
266
|
+
#### Basic Execution
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
bake <command> [args]
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
bake hello
|
|
274
|
+
bake build
|
|
275
|
+
bake test --verbose
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
#### Dry-Run Mode
|
|
279
|
+
|
|
280
|
+
Preview what would happen without executing:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
bake -n build
|
|
284
|
+
bake --dry-run deploy
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
#### Verbosity Levels
|
|
288
|
+
|
|
289
|
+
Control output verbosity:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
bake build # Silent (errors only)
|
|
293
|
+
bake -v build # Info level
|
|
294
|
+
bake -vv build # Debug level
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### Chaining Commands
|
|
298
|
+
|
|
299
|
+
Run multiple commands sequentially:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
bake -c lint test build
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
If any command fails, the chain stops.
|
|
306
|
+
|
|
307
|
+
#### Options
|
|
308
|
+
|
|
309
|
+
Override defaults when running bake:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
bake -f tasks.py build # Custom filename
|
|
313
|
+
bake -b my_bakebook build # Custom bakebook object name
|
|
314
|
+
bake -C /path/to/project build # Run from different directory
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### `bakefile` CLI - Managing bakefile.py
|
|
318
|
+
|
|
319
|
+
The `bakefile` command (short: `bf`) manages your `bakefile.py`.
|
|
320
|
+
|
|
321
|
+
#### init
|
|
322
|
+
|
|
323
|
+
Create a new `bakefile.py`:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
bakefile init # Basic bakefile
|
|
327
|
+
bakefile init --inline # With PEP 723 inline metadata
|
|
328
|
+
bakefile init --force # Force overwrite existing bakefile
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
#### add-inline
|
|
332
|
+
|
|
333
|
+
Add PEP 723 inline metadata to an existing bakefile:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
bakefile add-inline
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
#### lint
|
|
340
|
+
|
|
341
|
+
Lint `bakefile.py` (or entire project) with ruff and ty:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
bakefile lint # Lint bakefile.py and all Python files
|
|
345
|
+
bakefile lint --only-bakefile # Lint only bakefile.py
|
|
346
|
+
bakefile lint --no-ty # Skip type checking
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### uv-based commands (PEP 723 bakefile.py only)
|
|
350
|
+
|
|
351
|
+
Convenience wrappers around `uv` commands with `--script bakefile.py` added. For PEP 723 bakefile.py files only. For normal Python projects, use your preferred dependency manager (pip, poetry, uv, etc.).
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
bakefile sync # = uv sync --script bakefile.py
|
|
355
|
+
bakefile lock # = uv lock --script bakefile.py
|
|
356
|
+
bakefile add requests # = uv add --script bakefile.py requests
|
|
357
|
+
bakefile pip install # = uv pip install --python <bakefile-python-path>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### find-python
|
|
361
|
+
|
|
362
|
+
Find the Python interpreter path for the bakefile:
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
bakefile find-python
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
#### export
|
|
369
|
+
|
|
370
|
+
Export bakebook variables to external formats:
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
bakefile export # Shell format (default)
|
|
374
|
+
bakefile export -f sh # Shell format
|
|
375
|
+
bakefile export -f dotenv # .env format
|
|
376
|
+
bakefile export -f json # JSON format
|
|
377
|
+
bakefile export -f yaml # YAML format
|
|
378
|
+
bakefile export -o config.sh # Write to file
|
|
379
|
+
|
|
380
|
+
# Examples:
|
|
381
|
+
bakefile export -f dotenv -o .env # .env file
|
|
382
|
+
bakefile export -f json -o config.json # JSON file
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### `bakelib` - Optional Helpers
|
|
386
|
+
|
|
387
|
+
**bakelib** is an optional collection of opinionated helpers built on top of Bakebook. Includes Spaces (pre-configured tasks) and Environ (multi-environment support).
|
|
388
|
+
|
|
389
|
+
Install with:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
pip install bakefile[lib]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Note:** bakelib is optional—you can use bakefile without it. Create your own Bakebook classes if you prefer different conventions.
|
|
396
|
+
|
|
397
|
+
#### PythonSpace
|
|
398
|
+
|
|
399
|
+
PythonSpace provides common tasks for Python projects:
|
|
400
|
+
|
|
401
|
+
```python
|
|
402
|
+
from bakelib import PythonSpace
|
|
403
|
+
|
|
404
|
+
bakebook = PythonSpace()
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Available commands:
|
|
408
|
+
|
|
409
|
+
- `bake lint` - Run prettier, toml-sort, ruff format, ruff check, ty, deptry
|
|
410
|
+
- `bake test` - Run pytest with coverage on `tests/unit/`
|
|
411
|
+
- `bake test-integration` - Run integration tests from `tests/integration/`
|
|
412
|
+
- `bake test-all` - Run all tests
|
|
413
|
+
- `bake clean` - Clean gitignored files (with exclusions)
|
|
414
|
+
- `bake clean-all` - Clean all gitignored files
|
|
415
|
+
- `bake setup-dev` - Setup Python development environment
|
|
416
|
+
- `bake tools` - List development tools
|
|
417
|
+
- `bake update` - Upgrade dependencies (includes uv lock --upgrade)
|
|
418
|
+
|
|
419
|
+
#### Creating Custom Spaces
|
|
420
|
+
|
|
421
|
+
Create custom spaces by inheriting from BaseSpace:
|
|
422
|
+
|
|
423
|
+
```python
|
|
424
|
+
from bakelib import BaseSpace
|
|
425
|
+
from bake import Context
|
|
426
|
+
|
|
427
|
+
class MySpace(BaseSpace):
|
|
428
|
+
def test(self, ctx: Context) -> None:
|
|
429
|
+
ctx.run("npm test")
|
|
430
|
+
|
|
431
|
+
bakebook = MySpace()
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
BaseSpace provides these tasks (override as needed):
|
|
435
|
+
|
|
436
|
+
- `lint()` - Run prettier
|
|
437
|
+
- `clean()` / `clean_all()` - Clean gitignored files
|
|
438
|
+
- `setup_dev()` - Setup development environment
|
|
439
|
+
- `tools()` - List development tools
|
|
440
|
+
- `update()` - Upgrade dependencies
|
|
441
|
+
|
|
442
|
+
#### Multi-Environment Bakebooks
|
|
443
|
+
|
|
444
|
+
For projects with multiple environments (dev, staging, prod), use environment bakebooks:
|
|
445
|
+
|
|
446
|
+
```python
|
|
447
|
+
from bakelib.environ import (
|
|
448
|
+
DevEnvBakebook,
|
|
449
|
+
StagingEnvBakebook,
|
|
450
|
+
ProdEnvBakebook,
|
|
451
|
+
get_bakebook,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
bakebook_dev = DevEnvBakebook()
|
|
455
|
+
bakebook_staging = StagingEnvBakebook()
|
|
456
|
+
bakebook_prod = ProdEnvBakebook()
|
|
457
|
+
|
|
458
|
+
# Select bakebook based on ENV environment variable
|
|
459
|
+
bakebook = get_bakebook([bakebook_dev, bakebook_staging, bakebook_prod])
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
ENV=prod bake deploy # Uses prod bakebook
|
|
464
|
+
ENV=dev bake deploy # Uses dev bakebook
|
|
465
|
+
bake deploy # Defaults to dev (lowest priority)
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Create custom environments by inheriting from `BaseEnv`:
|
|
469
|
+
|
|
470
|
+
```python
|
|
471
|
+
from bakelib.environ import BaseEnv, EnvBakebook
|
|
472
|
+
|
|
473
|
+
class MyEnv(BaseEnv):
|
|
474
|
+
ENV_ORDER = ["dev", "sit", "qa", "uat", "prod"]
|
|
475
|
+
|
|
476
|
+
class MyEnvBakebook(EnvBakebook):
|
|
477
|
+
env_: MyEnv = MyEnv("local")
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
For more details, see the [bakelib source](https://github.com/wislertt/bakefile/tree/main/src/bakelib).
|
|
481
|
+
|
|
482
|
+
## Development
|
|
483
|
+
|
|
484
|
+
### Environment Setup
|
|
485
|
+
|
|
486
|
+
Clone and install the project:
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
git clone https://github.com/wislertt/bakefile.git
|
|
490
|
+
cd bakefile
|
|
491
|
+
|
|
492
|
+
# Install bakefile as a global tool
|
|
493
|
+
uv tool install bakefile
|
|
494
|
+
|
|
495
|
+
# Setup development environment (macOS only)
|
|
496
|
+
# Installs brew, bun, uv, and pre-commit hooks
|
|
497
|
+
bake setup-dev
|
|
498
|
+
|
|
499
|
+
# Verify development environment is setup correctly
|
|
500
|
+
# Checks tool locations and runs lint + test
|
|
501
|
+
bake assert-setup-dev
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**Note:** `bake setup-dev` only supports macOS. For other platforms, run `bake --dry-run setup-dev` to see the commands and follow platform-specific alternatives.
|
|
505
|
+
|
|
506
|
+
The project uses [uv](https://github.com/astral-sh/uv) for dependency management.
|
|
507
|
+
|
|
508
|
+
### Testing
|
|
509
|
+
|
|
510
|
+
Run tests using the bake commands:
|
|
511
|
+
|
|
512
|
+
```bash
|
|
513
|
+
bake test # Unit tests (fast)
|
|
514
|
+
bake test-integration # Integration tests (slow, real subprocess)
|
|
515
|
+
bake test-all # All tests with coverage
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### Code Quality
|
|
519
|
+
|
|
520
|
+
Run linters and formatters before committing:
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
bake lint # Run prettier, toml-sort, ruff format, ruff check, ty, deptry
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
**Verification workflow:**
|
|
527
|
+
|
|
528
|
+
1. Make changes
|
|
529
|
+
2. Run `bake lint` to check code quality
|
|
530
|
+
3. Run `bake test` to verify unit tests pass
|
|
531
|
+
4. Commit when both pass
|
|
532
|
+
|
|
533
|
+
## Contributing
|
|
534
|
+
|
|
535
|
+
Contributions are welcome! Please see [CLAUDE.md](/.claude/CLAUDE.md) for development guidelines, including:
|
|
536
|
+
|
|
537
|
+
- Project structure and testing conventions
|
|
538
|
+
- Code quality standards
|
|
539
|
+
- Development workflow
|
|
540
|
+
|
|
541
|
+
## License
|
|
542
|
+
|
|
543
|
+
Licensed under the Apache License 2.0. See [LICENSE](/LICENSE) for the full text.
|
|
@@ -22,13 +22,13 @@ bake/cli/common/app.py,sha256=6tWCyMKHwSynYI3qzc1AfSfLS4p2P25AilOsThqLN7k,1296
|
|
|
22
22
|
bake/cli/common/context.py,sha256=miyA87yaZLeuTsBnjIQdo4f5QKsI3CtOByTrzAWtweQ,4013
|
|
23
23
|
bake/cli/common/exception_handler.py,sha256=2vLbqMeZlLxKqNWUkTs3cA-8l6IjK0dU3SyZlRb96YI,1759
|
|
24
24
|
bake/cli/common/obj.py,sha256=IcURtAHXRrwFkXZsVTTruEMeLddwowtBvpa5lBknpEk,7181
|
|
25
|
-
bake/cli/common/params.py,sha256=
|
|
25
|
+
bake/cli/common/params.py,sha256=xgOPxuqZMO5V8p4j163h3raYuiSSVYtdhargAheN5xE,2278
|
|
26
26
|
bake/cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
bake/cli/utils/version.py,sha256=aiweLD0vDezBlJAcCC99oMms71WGD9CWSJuZ4i3VLHA,390
|
|
28
28
|
bake/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
bake/manage/add_inline.py,sha256=yefHmF33ghCB8NZ-v61ybeVsaeE8iDFvfRGeTAKg4I8,2245
|
|
30
30
|
bake/manage/find_python.py,sha256=67PAFPDA3fdSsDGjYfPcXOVUcgC63wg5mipjVIt1VUQ,7730
|
|
31
|
-
bake/manage/lint.py,sha256=
|
|
31
|
+
bake/manage/lint.py,sha256=w2QdYLCg1p2-m6Dj9ZMb0ejtyHNz7HmvFfu7frb0TjY,2489
|
|
32
32
|
bake/manage/run_uv.py,sha256=QzlKeVpr20dXNDcwUgyJqnXT4MofRqK-6XkWpzBbUhE,3234
|
|
33
33
|
bake/manage/write_bakefile.py,sha256=efGViLk7sh-QX9Mox7yQw_A1Tp7EOuc_vmSTbFmXUm0,736
|
|
34
34
|
bake/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -66,7 +66,7 @@ bakelib/space/lib.py,sha256=2vjR5qLA-a6-WYUb_ii0oJdgB2fj3-kHtvmRB88203A,6007
|
|
|
66
66
|
bakelib/space/python.py,sha256=LRe6sNDJ6_iNv3bt2rJqp-gLzNiv3MgoN5XRyiIdmcw,3284
|
|
67
67
|
bakelib/space/python_lib.py,sha256=x-htl7p_O_sSGG9GyusrjmYtYraZUTfwRPhJaclbF6I,2820
|
|
68
68
|
bakelib/space/utils.py,sha256=Mp82CgpNMeG76slXaDs9GXa1r_ugoiJICvpsOaH_2tg,3206
|
|
69
|
-
bakefile-0.0.
|
|
70
|
-
bakefile-0.0.
|
|
71
|
-
bakefile-0.0.
|
|
72
|
-
bakefile-0.0.
|
|
69
|
+
bakefile-0.0.14.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
|
|
70
|
+
bakefile-0.0.14.dist-info/entry_points.txt,sha256=Ecvvh7BYHCPJ0UdntrDc3Od6AZdRPXN5Z7o_7ok_0Qw,107
|
|
71
|
+
bakefile-0.0.14.dist-info/METADATA,sha256=xN0FJBWwwh_0tXKRWK7nbRAaiap-PuWhT-273KwdqGk,15097
|
|
72
|
+
bakefile-0.0.14.dist-info/RECORD,,
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: bakefile
|
|
3
|
-
Version: 0.0.13
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Author: Wisaroot Lertthaweedech
|
|
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
|
|
12
|
-
Requires-Dist: pydantic>=2.12.5
|
|
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: keyring>=25.7.0 ; extra == 'lib'
|
|
22
|
-
Requires-Dist: pathspec>=1.0.3 ; extra == 'lib'
|
|
23
|
-
Requires-Dist: tenacity>=9.1.2 ; extra == 'lib'
|
|
24
|
-
Requires-Python: >=3.10
|
|
25
|
-
Provides-Extra: lib
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
|
|
28
|
-
[](https://github.com/wislertt/bakefile/actions/workflows/cd.yml)
|
|
29
|
-
[](https://github.com/wislertt/bakefile/actions/workflows/cd.yml)
|
|
30
|
-
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
31
|
-
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
32
|
-
[](https://sonarcloud.io/summary/new_code?id=wislertt_bakefile)
|
|
33
|
-
[](https://codecov.io/gh/wislertt/bakefile)
|
|
34
|
-
[](https://pypi.python.org/pypi/bakefile)
|
|
35
|
-
[](https://pepy.tech/projects/bakefile)
|
|
36
|
-
[](https://github.com/wislertt/bakefile/)
|
|
37
|
-
|
|
38
|
-
# bakefile
|
|
39
|
-
|
|
40
|
-
🚧 **Note:** This project is under active development. 🚧
|
|
File without changes
|