scriptvault 0.2.1b0__tar.gz → 0.3.0__tar.gz

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 (30) hide show
  1. {scriptvault-0.2.1b0/src/scriptvault.egg-info → scriptvault-0.3.0}/PKG-INFO +35 -2
  2. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/README.md +33 -1
  3. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/pyproject.toml +3 -3
  4. scriptvault-0.3.0/src/scriptvault/__init__.py +8 -0
  5. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/cli.py +237 -188
  6. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/run.py +179 -40
  7. scriptvault-0.3.0/src/scriptvault/templates.py +275 -0
  8. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/vault.py +50 -75
  9. {scriptvault-0.2.1b0 → scriptvault-0.3.0/src/scriptvault.egg-info}/PKG-INFO +35 -2
  10. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault.egg-info/SOURCES.txt +2 -0
  11. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault.egg-info/requires.txt +1 -0
  12. scriptvault-0.3.0/tests/test_guide.py +73 -0
  13. scriptvault-0.3.0/tests/test_hooks.py +181 -0
  14. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_init.py +50 -3
  15. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_list.py +23 -0
  16. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_run.py +120 -0
  17. scriptvault-0.2.1b0/src/scriptvault/__init__.py +0 -8
  18. scriptvault-0.2.1b0/src/scriptvault/templates.py +0 -93
  19. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/LICENSE +0 -0
  20. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/setup.cfg +0 -0
  21. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/__main__.py +0 -0
  22. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/envfile.py +0 -0
  23. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault/term.py +0 -0
  24. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault.egg-info/dependency_links.txt +0 -0
  25. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault.egg-info/entry_points.txt +0 -0
  26. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/src/scriptvault.egg-info/top_level.txt +0 -0
  27. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_add.py +0 -0
  28. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_completion.py +0 -0
  29. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_edit.py +0 -0
  30. {scriptvault-0.2.1b0 → scriptvault-0.3.0}/tests/test_real.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptvault
3
- Version: 0.2.1b0
3
+ Version: 0.3.0
4
4
  Summary: Store and run project commands in a hidden vault directory
5
5
  Author: Majwt
6
6
  License-Expression: MIT
@@ -16,6 +16,7 @@ Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Provides-Extra: dev
18
18
  Requires-Dist: pytest>=8; extra == "dev"
19
+ Requires-Dist: flake8>=7; extra == "dev"
19
20
  Dynamic: license-file
20
21
 
21
22
  # ScriptVault (`sv`)
@@ -68,6 +69,8 @@ List targets:
68
69
  sv list
69
70
  ```
70
71
 
72
+ Running `sv` with no arguments prints the usage and every runnable target.
73
+
71
74
  ## Vault layout
72
75
 
73
76
  ```text
@@ -75,6 +78,7 @@ sv list
75
78
  .sv/
76
79
  vault.toml
77
80
  .env
81
+ GUIDE.md
78
82
  scripts/
79
83
  hello.sh
80
84
  hello.env
@@ -88,6 +92,7 @@ sv list
88
92
 
89
93
  - `vault.toml` defines inline scripts, orchestrations, and nested vault includes.
90
94
  - `.env` is the global dotenv file.
95
+ - `GUIDE.md` is the generated reference (see [Guide](#guide)).
91
96
  - `scripts/*.sh` are executable file scripts.
92
97
  - `scripts/NAME.env` is the per-script dotenv file.
93
98
  - `[include.NAME]` sections load scripts from nested vaults (see below).
@@ -174,6 +179,22 @@ sv ci
174
179
 
175
180
  Orchestrations can call scripts and other orchestrations. `sv` detects cycles and reports them.
176
181
 
182
+ ## Interrupting runs
183
+
184
+ Scripts that run until `^C` (servers, watchers, `dotnet` HTTP apps) get the
185
+ interrupt directly: `sv` and its children share the terminal's process group,
186
+ and `sv` itself ignores the first `^C` so the script can shut down. `sv` then
187
+ exits with the script's exit code.
188
+
189
+ If the script hangs during shutdown, press `^C` a second time: `sv` kills every
190
+ child it started and exits with code 130. A `^C` while no script is running
191
+ also exits with 130.
192
+
193
+ ```sh
194
+ sv serve # first ^C: the server stops, sv waits and exits with its code
195
+ # second ^C: sv kills the server and exits 130
196
+ ```
197
+
177
198
  ## Environment
178
199
 
179
200
  Environment files are dotenv-style `KEY=VALUE` files.
@@ -257,10 +278,22 @@ sv completion fish | source
257
278
  ## Help
258
279
 
259
280
  ```sh
260
- sv help
281
+ sv # usage plus every runnable target
282
+ sv help # usage only
261
283
  sv --version
262
284
  ```
263
285
 
286
+ ## Guide
287
+
288
+ `sv init` writes `.sv/GUIDE.md`, a reference for scripts, orchestrations,
289
+ nested vaults, and environment injection. The guide is stamped with the sv
290
+ version that generated it:
291
+
292
+ ```sh
293
+ sv guide # rewrite it only when that stamp is older than this sv
294
+ sv guide --force # rewrite it either way
295
+ ```
296
+
264
297
  ## Documentation
265
298
 
266
299
  For detailed guides and documentation:
@@ -48,6 +48,8 @@ List targets:
48
48
  sv list
49
49
  ```
50
50
 
51
+ Running `sv` with no arguments prints the usage and every runnable target.
52
+
51
53
  ## Vault layout
52
54
 
53
55
  ```text
@@ -55,6 +57,7 @@ sv list
55
57
  .sv/
56
58
  vault.toml
57
59
  .env
60
+ GUIDE.md
58
61
  scripts/
59
62
  hello.sh
60
63
  hello.env
@@ -68,6 +71,7 @@ sv list
68
71
 
69
72
  - `vault.toml` defines inline scripts, orchestrations, and nested vault includes.
70
73
  - `.env` is the global dotenv file.
74
+ - `GUIDE.md` is the generated reference (see [Guide](#guide)).
71
75
  - `scripts/*.sh` are executable file scripts.
72
76
  - `scripts/NAME.env` is the per-script dotenv file.
73
77
  - `[include.NAME]` sections load scripts from nested vaults (see below).
@@ -154,6 +158,22 @@ sv ci
154
158
 
155
159
  Orchestrations can call scripts and other orchestrations. `sv` detects cycles and reports them.
156
160
 
161
+ ## Interrupting runs
162
+
163
+ Scripts that run until `^C` (servers, watchers, `dotnet` HTTP apps) get the
164
+ interrupt directly: `sv` and its children share the terminal's process group,
165
+ and `sv` itself ignores the first `^C` so the script can shut down. `sv` then
166
+ exits with the script's exit code.
167
+
168
+ If the script hangs during shutdown, press `^C` a second time: `sv` kills every
169
+ child it started and exits with code 130. A `^C` while no script is running
170
+ also exits with 130.
171
+
172
+ ```sh
173
+ sv serve # first ^C: the server stops, sv waits and exits with its code
174
+ # second ^C: sv kills the server and exits 130
175
+ ```
176
+
157
177
  ## Environment
158
178
 
159
179
  Environment files are dotenv-style `KEY=VALUE` files.
@@ -237,10 +257,22 @@ sv completion fish | source
237
257
  ## Help
238
258
 
239
259
  ```sh
240
- sv help
260
+ sv # usage plus every runnable target
261
+ sv help # usage only
241
262
  sv --version
242
263
  ```
243
264
 
265
+ ## Guide
266
+
267
+ `sv init` writes `.sv/GUIDE.md`, a reference for scripts, orchestrations,
268
+ nested vaults, and environment injection. The guide is stamped with the sv
269
+ version that generated it:
270
+
271
+ ```sh
272
+ sv guide # rewrite it only when that stamp is older than this sv
273
+ sv guide --force # rewrite it either way
274
+ ```
275
+
244
276
  ## Documentation
245
277
 
246
278
  For detailed guides and documentation:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scriptvault"
7
- version = "0.2.1b0"
7
+ version = "0.3.0"
8
8
  description = "Store and run project commands in a hidden vault directory"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -24,10 +24,10 @@ classifiers = [
24
24
  sv = "scriptvault.cli:main"
25
25
 
26
26
  [project.optional-dependencies]
27
- dev = ["pytest>=8"]
27
+ dev = ["pytest>=8", "flake8>=7"]
28
28
 
29
29
  [dependency-groups]
30
- dev = ["pytest>=8"]
30
+ dev = ["pytest>=8", "flake8>=7"]
31
31
 
32
32
  [tool.setuptools.packages.find]
33
33
  where = ["src"]
@@ -0,0 +1,8 @@
1
+ """ScriptVault: store and run project commands in a hidden vault directory."""
2
+
3
+ from importlib.metadata import PackageNotFoundError
4
+
5
+ try:
6
+ __version__ = "0.3.0"
7
+ except PackageNotFoundError:
8
+ __version__ = "0.3.0"