boundver 0.9.0__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.
boundver/__init__.py ADDED
@@ -0,0 +1,12 @@
1
+ """boundver package."""
2
+
3
+ __all__ = ["main"]
4
+
5
+ from importlib.metadata import PackageNotFoundError, version
6
+
7
+ from .cli import main
8
+
9
+ try:
10
+ __version__ = version("boundver")
11
+ except PackageNotFoundError: # pragma: no cover
12
+ __version__ = "0.0.0+local"
@@ -0,0 +1,259 @@
1
+ """Shell completion scripts for boundver."""
2
+
3
+ from typing import Dict
4
+
5
+ _BASH_COMPLETION = """\
6
+ # boundver bash completion
7
+ # Source this file or add to ~/.bash_completion.d/
8
+ _boundver_completions() {
9
+ local cur prev words cword
10
+ _init_completion 2>/dev/null || {
11
+ COMP_WORDS=("${COMP_WORDS[@]}")
12
+ cword=$COMP_CWORD
13
+ cur="${COMP_WORDS[$cword]}"
14
+ prev="${COMP_WORDS[$cword-1]}"
15
+ }
16
+
17
+ local commands="generate verify diff slice validate-config init status explain why discover completions"
18
+ local global_opts="--quiet --verbose --help"
19
+
20
+ case "${COMP_WORDS[1]}" in
21
+ generate)
22
+ case "$prev" in
23
+ --source) COMPREPLY=($(compgen -W "head index working-tree" -- "$cur")); return ;;
24
+ --format) COMPREPLY=($(compgen -W "json text" -- "$cur")); return ;;
25
+ --config|--out) COMPREPLY=($(compgen -f -- "$cur")); return ;;
26
+ esac
27
+ COMPREPLY=($(compgen -W "--config --out --source --allow-partial --dry-run --components --format --allow-custom-providers --quiet --verbose" -- "$cur")) ;;
28
+ verify)
29
+ case "$prev" in
30
+ --source) COMPREPLY=($(compgen -W "head index working-tree" -- "$cur")); return ;;
31
+ --format) COMPREPLY=($(compgen -W "json text" -- "$cur")); return ;;
32
+ --config|--lock) COMPREPLY=($(compgen -f -- "$cur")); return ;;
33
+ esac
34
+ COMPREPLY=($(compgen -W "--config --lock --source --components --changed-from --format --allow-custom-providers --quiet --verbose" -- "$cur")) ;;
35
+ diff)
36
+ case "$prev" in
37
+ --format) COMPREPLY=($(compgen -W "json text" -- "$cur")); return ;;
38
+ esac
39
+ COMPREPLY=($(compgen -W "--format" -- "$cur")) ;;
40
+ slice)
41
+ case "$prev" in
42
+ --lock) COMPREPLY=($(compgen -f -- "$cur")); return ;;
43
+ esac
44
+ COMPREPLY=($(compgen -W "--lock" -- "$cur")) ;;
45
+ validate-config)
46
+ COMPREPLY=($(compgen -W "--config --allow-custom-providers" -- "$cur")) ;;
47
+ init)
48
+ COMPREPLY=($(compgen -W "--out --force --discover" -- "$cur")) ;;
49
+ status)
50
+ case "$prev" in
51
+ --source) COMPREPLY=($(compgen -W "head index working-tree" -- "$cur")); return ;;
52
+ --format) COMPREPLY=($(compgen -W "json text" -- "$cur")); return ;;
53
+ esac
54
+ COMPREPLY=($(compgen -W "--config --lock --source --format --quiet" -- "$cur")) ;;
55
+ explain)
56
+ case "$prev" in
57
+ --config) COMPREPLY=($(compgen -f -- "$cur")); return ;;
58
+ esac
59
+ COMPREPLY=($(compgen -W "--config --base-ref" -- "$cur")) ;;
60
+ why)
61
+ case "$prev" in
62
+ --source) COMPREPLY=($(compgen -W "head index working-tree" -- "$cur")); return ;;
63
+ --config|--lock) COMPREPLY=($(compgen -f -- "$cur")); return ;;
64
+ esac
65
+ COMPREPLY=($(compgen -W "--config --lock --source" -- "$cur")) ;;
66
+ discover)
67
+ case "$prev" in
68
+ --format) COMPREPLY=($(compgen -W "json text" -- "$cur")); return ;;
69
+ esac
70
+ COMPREPLY=($(compgen -W "--format" -- "$cur")) ;;
71
+ completions)
72
+ case "$prev" in
73
+ --shell) COMPREPLY=($(compgen -W "bash zsh fish" -- "$cur")); return ;;
74
+ esac
75
+ COMPREPLY=($(compgen -W "--shell" -- "$cur")) ;;
76
+ *)
77
+ if [[ $cword -eq 1 ]]; then
78
+ COMPREPLY=($(compgen -W "$commands $global_opts" -- "$cur"))
79
+ fi ;;
80
+ esac
81
+ }
82
+ complete -F _boundver_completions boundver
83
+ """
84
+
85
+ _ZSH_COMPLETION = """\
86
+ #compdef boundver
87
+ # boundver zsh completion — place in a $fpath directory as _boundver
88
+
89
+ _boundver() {
90
+ local -a commands
91
+ commands=(
92
+ 'generate:Generate or update the lockfile'
93
+ 'verify:Check lockfile matches current repo state'
94
+ 'diff:Diff two lockfiles'
95
+ 'slice:Show fingerprint for a specific slice'
96
+ 'validate-config:Validate config for strict boundary rules'
97
+ 'init:Create a starter boundary.config.json'
98
+ 'status:Show lockfile summary and warnings'
99
+ 'explain:Explain changed files for a component'
100
+ 'why:Explain why a component lockfile is out of date'
101
+ 'discover:Print discovered components as JSON'
102
+ 'completions:Emit shell completion scripts'
103
+ )
104
+ case "$words[2]" in
105
+ generate)
106
+ _arguments \\
107
+ '--config[Config file path]:file:_files' \\
108
+ '--out[Output lockfile path]:file:_files' \\
109
+ '--source[Fingerprint source]:source:(head index working-tree)' \\
110
+ '--allow-partial[Allow missing digests]' \\
111
+
112
+ '--dry-run[Do not write output]' \\
113
+ '--components[Component names (comma-separated)]:components:' \\
114
+ '--format[Output format]:format:(json text)' \\
115
+ '--allow-custom-providers[Allow loading external provider modules]' \\
116
+ '--quiet[Suppress output]' \\
117
+ '--verbose[Extra diagnostics]' ;;
118
+ verify)
119
+ _arguments \\
120
+ '--config[Config file path]:file:_files' \\
121
+ '--lock[Lockfile path]:file:_files' \\
122
+ '--source[Fingerprint source]:source:(head index working-tree)' \\
123
+ '--components[Component names (comma-separated)]:components:' \\
124
+ '--changed-from[Auto-select changed components since ref]:ref:' \\
125
+ '--format[Output format]:format:(json text)' \\
126
+ '--allow-custom-providers[Allow loading external provider modules]' \\
127
+ '--quiet[Suppress output]' \\
128
+ '--verbose[Extra diagnostics]' ;;
129
+ diff)
130
+ _arguments \\
131
+ ':old lockfile:_files' \\
132
+ ':new lockfile:_files' \\
133
+ '--format[Output format]:format:(json text)' ;;
134
+ slice)
135
+ _arguments \\
136
+ ':slice name:' \\
137
+ '--lock[Lockfile path]:file:_files' ;;
138
+ validate-config)
139
+ _arguments '--config[Config file path]:file:_files' \\
140
+ '--allow-custom-providers[Allow loading external provider modules]' ;;
141
+ init)
142
+ _arguments \\
143
+ '--out[Output config path]:file:_files' \\
144
+ '--force[Overwrite existing]' \\
145
+ '--discover[Auto-discover components]' ;;
146
+ status)
147
+ _arguments \\
148
+ '--config[Config file path]:file:_files' \\
149
+ '--lock[Lockfile path]:file:_files' \\
150
+ '--source[Fingerprint source]:source:(head index working-tree)' \\
151
+ '--format[Output format]:format:(json text)' \\
152
+ '--quiet[Suppress output]' ;;
153
+ explain)
154
+ _arguments \\
155
+ ':component name:' \\
156
+ '--config[Config file path]:file:_files' \\
157
+ '--base-ref[Git ref to diff against]:ref:' ;;
158
+ why)
159
+ _arguments \\
160
+ ':component name:' \\
161
+ '--config[Config file path]:file:_files' \\
162
+ '--lock[Lockfile path]:file:_files' \\
163
+ '--source[Fingerprint source]:source:(head index working-tree)' ;;
164
+ discover)
165
+ _arguments '--format[Output format]:format:(json text)' ;;
166
+ completions)
167
+ _arguments '--shell[Shell type]:shell:(bash zsh fish)' ;;
168
+ *)
169
+ _describe 'command' commands ;;
170
+ esac
171
+ }
172
+ _boundver
173
+ """
174
+
175
+ _FISH_COMPLETION = """\
176
+ # boundver fish completion
177
+ # Place in ~/.config/fish/completions/boundver.fish
178
+
179
+ set -l __boundver_cmds generate verify diff slice validate-config init status explain why discover completions
180
+
181
+ # subcommands
182
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a generate -d 'Generate or update the lockfile'
183
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a verify -d 'Check lockfile matches current repo state'
184
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a diff -d 'Diff two lockfiles'
185
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a slice -d 'Show fingerprint for a specific slice'
186
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a validate-config -d 'Validate config'
187
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a init -d 'Create a starter boundary.config.json'
188
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a status -d 'Show lockfile summary and warnings'
189
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a explain -d 'Explain changed files for a component'
190
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a why -d 'Explain why a component lockfile is out of date'
191
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a discover -d 'Print discovered components as JSON'
192
+ complete -c boundver -f -n "not __fish_seen_subcommand_from $__boundver_cmds" -a completions -d 'Emit shell completion scripts'
193
+
194
+ # generate
195
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l config -d 'Config file path' -F
196
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l out -d 'Output lockfile path' -F
197
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l source -d 'Fingerprint source' -a 'head index working-tree'
198
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l format -d 'Output format' -a 'json text'
199
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l components -d 'Component names'
200
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l allow-partial -d 'Allow missing digests'
201
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l dry-run -d 'Do not write output'
202
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l allow-custom-providers -d 'Allow loading external provider modules'
203
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l quiet -d 'Suppress output'
204
+ complete -c boundver -n "__fish_seen_subcommand_from generate" -l verbose -d 'Extra diagnostics'
205
+
206
+ # verify
207
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l config -d 'Config file path' -F
208
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l lock -d 'Lockfile path' -F
209
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l source -d 'Fingerprint source' -a 'head index working-tree'
210
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l format -d 'Output format' -a 'json text'
211
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l components -d 'Component names'
212
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l changed-from -d 'Auto-select changed since ref'
213
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l allow-custom-providers -d 'Allow loading external provider modules'
214
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l quiet -d 'Suppress output'
215
+ complete -c boundver -n "__fish_seen_subcommand_from verify" -l verbose -d 'Extra diagnostics'
216
+
217
+ # diff
218
+ complete -c boundver -n "__fish_seen_subcommand_from diff" -l format -d 'Output format' -a 'json text'
219
+
220
+ # slice
221
+ complete -c boundver -n "__fish_seen_subcommand_from slice" -l lock -d 'Lockfile path' -F
222
+
223
+ # validate-config
224
+ complete -c boundver -n "__fish_seen_subcommand_from validate-config" -l config -d 'Config file path' -F
225
+ complete -c boundver -n "__fish_seen_subcommand_from validate-config" -l allow-custom-providers -d 'Allow loading external provider modules'
226
+
227
+ # init
228
+ complete -c boundver -n "__fish_seen_subcommand_from init" -l out -d 'Output config path' -F
229
+ complete -c boundver -n "__fish_seen_subcommand_from init" -l force -d 'Overwrite existing'
230
+ complete -c boundver -n "__fish_seen_subcommand_from init" -l discover -d 'Auto-discover components'
231
+
232
+ # status
233
+ complete -c boundver -n "__fish_seen_subcommand_from status" -l config -d 'Config file path' -F
234
+ complete -c boundver -n "__fish_seen_subcommand_from status" -l lock -d 'Lockfile path' -F
235
+ complete -c boundver -n "__fish_seen_subcommand_from status" -l source -d 'Fingerprint source' -a 'head index working-tree'
236
+ complete -c boundver -n "__fish_seen_subcommand_from status" -l format -d 'Output format' -a 'json text'
237
+ complete -c boundver -n "__fish_seen_subcommand_from status" -l quiet -d 'Suppress output'
238
+
239
+ # explain
240
+ complete -c boundver -n "__fish_seen_subcommand_from explain" -l config -d 'Config file path' -F
241
+ complete -c boundver -n "__fish_seen_subcommand_from explain" -l base-ref -d 'Git ref to diff against'
242
+
243
+ # why
244
+ complete -c boundver -n "__fish_seen_subcommand_from why" -l config -d 'Config file path' -F
245
+ complete -c boundver -n "__fish_seen_subcommand_from why" -l lock -d 'Lockfile path' -F
246
+ complete -c boundver -n "__fish_seen_subcommand_from why" -l source -d 'Fingerprint source' -a 'head index working-tree'
247
+
248
+ # discover
249
+ complete -c boundver -n "__fish_seen_subcommand_from discover" -l format -d 'Output format' -a 'json text'
250
+
251
+ # completions
252
+ complete -c boundver -n "__fish_seen_subcommand_from completions" -l shell -d 'Shell type' -a 'bash zsh fish'
253
+ """
254
+
255
+ _COMPLETION_SCRIPTS: Dict[str, str] = {
256
+ "bash": _BASH_COMPLETION,
257
+ "zsh": _ZSH_COMPLETION,
258
+ "fish": _FISH_COMPLETION,
259
+ }