cu-cli 0.1.0b1__tar.gz → 0.1.0b2__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.
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/PKG-INFO +66 -7
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/README.md +63 -4
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/pyproject.toml +3 -12
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/apiversion.py +11 -6
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/cli.py +2 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_command_spec.py +15 -4
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_infra_models.py +3 -8
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_infra_wizard.py +54 -248
- cu_cli-0.1.0b2/src/cu_cli/commands/_postprovision.py +208 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/analyze.py +205 -40
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/doctor.py +38 -71
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/infra.py +6 -33
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/profile_cmd.py +4 -1
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/__init__.py +4 -3
- cu_cli-0.1.0b2/src/cu_cli/core/doctor.py +17 -0
- cu_cli-0.1.0b2/src/cu_cli/core/infra_models.py +153 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/PKG-INFO +66 -7
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/SOURCES.txt +2 -10
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/requires.txt +1 -1
- cu_cli-0.1.0b1/src/cu_cli/core/doctor.py +0 -42
- cu_cli-0.1.0b1/src/cu_cli/core/infra_models.py +0 -367
- cu_cli-0.1.0b1/src/cu_cli/core/inputs.py +0 -209
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/README.md +0 -187
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/azure.yaml +0 -27
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/hooks/postprovision.ps1 +0 -320
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/hooks/postprovision.sh +0 -299
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/infra/main.bicep +0 -115
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/infra/main.parameters.json +0 -30
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/infra/models.json +0 -1
- cu_cli-0.1.0b1/src/cu_cli/resources/azd_template/infra/modules/foundry.bicep +0 -122
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/setup.cfg +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/__init__.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/__main__.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/client.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/__init__.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_help.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_model_setup.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/_options.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/analyzer.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/defaults.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/env_var.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/commands/upgrade.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/analyze.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/analyzers.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/azure_resources.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/defaults.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/foundry.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/core/schema.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/errors.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/exit_codes.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/modality.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/output.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/profile.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/py.typed +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/resources/__init__.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/schema_validate.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/spec_validate.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/telemetry.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/update_check.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/update_provider.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli/windows_self_upgrade.py +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/dependency_links.txt +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/entry_points.txt +0 -0
- {cu_cli-0.1.0b1 → cu_cli-0.1.0b2}/src/cu_cli.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cu-cli
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.0b2
|
|
4
|
+
Summary: Run Azure Content Understanding prebuilt analyzers, and/or author, validate, and run custom analyzers from the terminal — advanced document layout, industry-leading OCR, and grounded field extraction with confidence, all backed by Azure Content Understanding.
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/Azure/content-understanding-toolkit/tree/main/cu-cli
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
21
21
|
Classifier: Topic :: Text Processing
|
|
22
22
|
Requires-Python: >=3.10
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
|
-
Requires-Dist: cu-cli-core<0.2.0,>=0.1.
|
|
24
|
+
Requires-Dist: cu-cli-core<0.2.0,>=0.1.0b2
|
|
25
25
|
Requires-Dist: azure-ai-contentunderstanding>=1.2.0b3
|
|
26
26
|
Requires-Dist: azure-identity>=1.19
|
|
27
27
|
Requires-Dist: azure-mgmt-cognitiveservices>=13.5
|
|
@@ -44,7 +44,8 @@ Requires-Dist: vcrpy>=6.0; extra == "dev"
|
|
|
44
44
|
Foundry Tools. Use it to provision the required Microsoft Foundry resource,
|
|
45
45
|
optionally deploy selected supported large language models (LLMs) and embeddings
|
|
46
46
|
models, configure Content Understanding defaults, analyze local files, manage
|
|
47
|
-
analyzers, and manage local configuration.
|
|
47
|
+
analyzers, and manage local configuration. Analyze inputs can also be supplied
|
|
48
|
+
as HTTPS or Azure Blob SAS URLs.
|
|
48
49
|
|
|
49
50
|
> [!IMPORTANT]
|
|
50
51
|
> CU CLI is in preview. Commands and package contracts may change before general
|
|
@@ -72,8 +73,8 @@ The Content Understanding documentation uses these terms:
|
|
|
72
73
|
structured fields to extract.
|
|
73
74
|
|
|
74
75
|
CU CLI lets you configure a Microsoft Foundry resource, select an analyzer,
|
|
75
|
-
submit local files, and save analyzer results without calling the
|
|
76
|
-
directly.
|
|
76
|
+
submit local files or HTTPS URLs, and save analyzer results without calling the
|
|
77
|
+
REST API directly.
|
|
77
78
|
|
|
78
79
|
Further reading:
|
|
79
80
|
|
|
@@ -134,6 +135,47 @@ checks the API version, endpoint, authentication, service connectivity, and
|
|
|
134
135
|
Content Understanding defaults. It exits nonzero when a required check fails,
|
|
135
136
|
so it can serve as a readiness gate.
|
|
136
137
|
|
|
138
|
+
## Use `cu` and `az cu` interchangeably
|
|
139
|
+
|
|
140
|
+
The standalone CU CLI and the Azure CLI extension are two frontends over the
|
|
141
|
+
same `cu-cli-core` operations. Install either frontend, or install both and move
|
|
142
|
+
between them for the same analyzer, analysis, defaults, profile, diagnostics,
|
|
143
|
+
and infrastructure-generation workflows.
|
|
144
|
+
|
|
145
|
+
Both frontends read and write the same `[cu]` profile settings in the active
|
|
146
|
+
Azure CLI configuration file (`~/.azure/config` by default, or the file under
|
|
147
|
+
`AZURE_CONFIG_DIR`). An endpoint, API version, default analyzer, active profile,
|
|
148
|
+
or model-deployment mapping saved with one frontend is immediately available to
|
|
149
|
+
the other. For example:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Save the endpoint with the standalone frontend.
|
|
153
|
+
cu profile set endpoint https://<resource-name>.services.ai.azure.com/
|
|
154
|
+
|
|
155
|
+
# Use the same default profile with the Azure CLI extension.
|
|
156
|
+
az cu analyzer list --output table
|
|
157
|
+
|
|
158
|
+
# Change the default analyzer with the Azure CLI extension.
|
|
159
|
+
az cu profile set --key default_analyzer --value prebuilt-layout
|
|
160
|
+
|
|
161
|
+
# Use that setting with the standalone frontend.
|
|
162
|
+
cu analyze ./document.pdf
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The command names and capabilities overlap, but frontend conventions differ:
|
|
166
|
+
|
|
167
|
+
| Standalone CU CLI | Azure CLI extension |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| Starts commands with `cu` (`cu-cli` on macOS). | Starts commands with `az cu`. |
|
|
170
|
+
| Supports standalone positional shortcuts and Rich/JSON output options. | Uses explicit options plus global Azure CLI `--output`, `--query`, and `--subscription`. |
|
|
171
|
+
| Uses the profile's `auth_mode` and can use a saved API key. | Always uses the active `az login` identity; shared API keys and `auth_mode` do not override Azure CLI host authentication. |
|
|
172
|
+
|
|
173
|
+
Run `cu <command> --help` or `az cu <command> --help` when translating a command
|
|
174
|
+
between frontends. Profile values are shared; authentication sessions are not,
|
|
175
|
+
so sign in with `az login` before using `az cu`. For Azure CLI-specific
|
|
176
|
+
installation and command examples, see the
|
|
177
|
+
[Azure Content Understanding extension README](https://github.com/Azure/content-understanding-toolkit/blob/main/cu-cli/packages/azure-cli-extension/README.md).
|
|
178
|
+
|
|
137
179
|
## Supported Content Understanding API versions
|
|
138
180
|
|
|
139
181
|
Content Understanding API version. Known versions: 2025-11-01 (GA) and
|
|
@@ -182,6 +224,23 @@ model or embeddings model. `-a` is the short form of `--analyzer`:
|
|
|
182
224
|
cu analyze ./document.pdf -a prebuilt-layout
|
|
183
225
|
```
|
|
184
226
|
|
|
227
|
+
Analyze a remote file with `--url` without downloading it through the CLI.
|
|
228
|
+
Quote URLs that contain SAS query parameters so the shell preserves `&` characters:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
cu analyze --url "https://storage.example.net/container/video.mp4?sv=<version>&sp=r&sig=<signature>" \
|
|
232
|
+
--analyzer prebuilt-videoSearch
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Repeat `--url` for multiple URLs and specify `--output-dir` for their results.
|
|
236
|
+
`--url` cannot be combined with positional inputs, `--file`, or `--source`.
|
|
237
|
+
Positional URLs remain available as a standalone shortcut.
|
|
238
|
+
|
|
239
|
+
Remote inputs require HTTPS. Use a short-lived, read-only SAS and avoid placing
|
|
240
|
+
production SAS URLs in shared shell history. CU CLI removes URL query strings
|
|
241
|
+
from its status output and reports, while sending the original URL to Content
|
|
242
|
+
Understanding unchanged.
|
|
243
|
+
|
|
185
244
|
Markdown generated by the Content Understanding SDK's `to_llm_input()` helper is
|
|
186
245
|
the default output format. The helper formats field extraction results as
|
|
187
246
|
Markdown with YAML frontmatter so they can be used as generative AI model input.
|
|
@@ -271,7 +330,7 @@ Further reading:
|
|
|
271
330
|
|
|
272
331
|
| Command | Purpose |
|
|
273
332
|
| --- | --- |
|
|
274
|
-
| `cu analyze` | Analyze local files and return analyzer results. |
|
|
333
|
+
| `cu analyze` | Analyze local files or HTTPS URLs and return analyzer results. |
|
|
275
334
|
| `cu analyzer` | List, show, create, copy, delete, and test analyzers; create and validate local analyzer schemas. |
|
|
276
335
|
| `cu defaults` | Read or configure Content Understanding defaults that map models to deployments. |
|
|
277
336
|
| `cu profile` | Manage local CU CLI endpoint, authentication, API, and model settings. |
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
Foundry Tools. Use it to provision the required Microsoft Foundry resource,
|
|
5
5
|
optionally deploy selected supported large language models (LLMs) and embeddings
|
|
6
6
|
models, configure Content Understanding defaults, analyze local files, manage
|
|
7
|
-
analyzers, and manage local configuration.
|
|
7
|
+
analyzers, and manage local configuration. Analyze inputs can also be supplied
|
|
8
|
+
as HTTPS or Azure Blob SAS URLs.
|
|
8
9
|
|
|
9
10
|
> [!IMPORTANT]
|
|
10
11
|
> CU CLI is in preview. Commands and package contracts may change before general
|
|
@@ -32,8 +33,8 @@ The Content Understanding documentation uses these terms:
|
|
|
32
33
|
structured fields to extract.
|
|
33
34
|
|
|
34
35
|
CU CLI lets you configure a Microsoft Foundry resource, select an analyzer,
|
|
35
|
-
submit local files, and save analyzer results without calling the
|
|
36
|
-
directly.
|
|
36
|
+
submit local files or HTTPS URLs, and save analyzer results without calling the
|
|
37
|
+
REST API directly.
|
|
37
38
|
|
|
38
39
|
Further reading:
|
|
39
40
|
|
|
@@ -94,6 +95,47 @@ checks the API version, endpoint, authentication, service connectivity, and
|
|
|
94
95
|
Content Understanding defaults. It exits nonzero when a required check fails,
|
|
95
96
|
so it can serve as a readiness gate.
|
|
96
97
|
|
|
98
|
+
## Use `cu` and `az cu` interchangeably
|
|
99
|
+
|
|
100
|
+
The standalone CU CLI and the Azure CLI extension are two frontends over the
|
|
101
|
+
same `cu-cli-core` operations. Install either frontend, or install both and move
|
|
102
|
+
between them for the same analyzer, analysis, defaults, profile, diagnostics,
|
|
103
|
+
and infrastructure-generation workflows.
|
|
104
|
+
|
|
105
|
+
Both frontends read and write the same `[cu]` profile settings in the active
|
|
106
|
+
Azure CLI configuration file (`~/.azure/config` by default, or the file under
|
|
107
|
+
`AZURE_CONFIG_DIR`). An endpoint, API version, default analyzer, active profile,
|
|
108
|
+
or model-deployment mapping saved with one frontend is immediately available to
|
|
109
|
+
the other. For example:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Save the endpoint with the standalone frontend.
|
|
113
|
+
cu profile set endpoint https://<resource-name>.services.ai.azure.com/
|
|
114
|
+
|
|
115
|
+
# Use the same default profile with the Azure CLI extension.
|
|
116
|
+
az cu analyzer list --output table
|
|
117
|
+
|
|
118
|
+
# Change the default analyzer with the Azure CLI extension.
|
|
119
|
+
az cu profile set --key default_analyzer --value prebuilt-layout
|
|
120
|
+
|
|
121
|
+
# Use that setting with the standalone frontend.
|
|
122
|
+
cu analyze ./document.pdf
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The command names and capabilities overlap, but frontend conventions differ:
|
|
126
|
+
|
|
127
|
+
| Standalone CU CLI | Azure CLI extension |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| Starts commands with `cu` (`cu-cli` on macOS). | Starts commands with `az cu`. |
|
|
130
|
+
| Supports standalone positional shortcuts and Rich/JSON output options. | Uses explicit options plus global Azure CLI `--output`, `--query`, and `--subscription`. |
|
|
131
|
+
| Uses the profile's `auth_mode` and can use a saved API key. | Always uses the active `az login` identity; shared API keys and `auth_mode` do not override Azure CLI host authentication. |
|
|
132
|
+
|
|
133
|
+
Run `cu <command> --help` or `az cu <command> --help` when translating a command
|
|
134
|
+
between frontends. Profile values are shared; authentication sessions are not,
|
|
135
|
+
so sign in with `az login` before using `az cu`. For Azure CLI-specific
|
|
136
|
+
installation and command examples, see the
|
|
137
|
+
[Azure Content Understanding extension README](https://github.com/Azure/content-understanding-toolkit/blob/main/cu-cli/packages/azure-cli-extension/README.md).
|
|
138
|
+
|
|
97
139
|
## Supported Content Understanding API versions
|
|
98
140
|
|
|
99
141
|
Content Understanding API version. Known versions: 2025-11-01 (GA) and
|
|
@@ -142,6 +184,23 @@ model or embeddings model. `-a` is the short form of `--analyzer`:
|
|
|
142
184
|
cu analyze ./document.pdf -a prebuilt-layout
|
|
143
185
|
```
|
|
144
186
|
|
|
187
|
+
Analyze a remote file with `--url` without downloading it through the CLI.
|
|
188
|
+
Quote URLs that contain SAS query parameters so the shell preserves `&` characters:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
cu analyze --url "https://storage.example.net/container/video.mp4?sv=<version>&sp=r&sig=<signature>" \
|
|
192
|
+
--analyzer prebuilt-videoSearch
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Repeat `--url` for multiple URLs and specify `--output-dir` for their results.
|
|
196
|
+
`--url` cannot be combined with positional inputs, `--file`, or `--source`.
|
|
197
|
+
Positional URLs remain available as a standalone shortcut.
|
|
198
|
+
|
|
199
|
+
Remote inputs require HTTPS. Use a short-lived, read-only SAS and avoid placing
|
|
200
|
+
production SAS URLs in shared shell history. CU CLI removes URL query strings
|
|
201
|
+
from its status output and reports, while sending the original URL to Content
|
|
202
|
+
Understanding unchanged.
|
|
203
|
+
|
|
145
204
|
Markdown generated by the Content Understanding SDK's `to_llm_input()` helper is
|
|
146
205
|
the default output format. The helper formats field extraction results as
|
|
147
206
|
Markdown with YAML frontmatter so they can be used as generative AI model input.
|
|
@@ -231,7 +290,7 @@ Further reading:
|
|
|
231
290
|
|
|
232
291
|
| Command | Purpose |
|
|
233
292
|
| --- | --- |
|
|
234
|
-
| `cu analyze` | Analyze local files and return analyzer results. |
|
|
293
|
+
| `cu analyze` | Analyze local files or HTTPS URLs and return analyzer results. |
|
|
235
294
|
| `cu analyzer` | List, show, create, copy, delete, and test analyzers; create and validate local analyzer schemas. |
|
|
236
295
|
| `cu defaults` | Read or configure Content Understanding defaults that map models to deployments. |
|
|
237
296
|
| `cu profile` | Manage local CU CLI endpoint, authentication, API, and model settings. |
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cu-cli"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "
|
|
7
|
+
version = "0.1.0b2"
|
|
8
|
+
description = "Run Azure Content Understanding prebuilt analyzers, and/or author, validate, and run custom analyzers from the terminal — advanced document layout, industry-leading OCR, and grounded field extraction with confidence, all backed by Azure Content Understanding."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = { text = "MIT" }
|
|
@@ -27,7 +27,7 @@ classifiers = [
|
|
|
27
27
|
"Topic :: Text Processing",
|
|
28
28
|
]
|
|
29
29
|
dependencies = [
|
|
30
|
-
"cu-cli-core>=0.1.
|
|
30
|
+
"cu-cli-core>=0.1.0b2,<0.2.0",
|
|
31
31
|
"azure-ai-contentunderstanding>=1.2.0b3",
|
|
32
32
|
"azure-identity>=1.19",
|
|
33
33
|
# Management-plane clients used by `cu analyzer copy` to resolve
|
|
@@ -68,15 +68,6 @@ where = ["src"]
|
|
|
68
68
|
|
|
69
69
|
[tool.setuptools.package-data]
|
|
70
70
|
"cu_cli" = ["py.typed"]
|
|
71
|
-
"cu_cli.resources" = [
|
|
72
|
-
"azd_template/azure.yaml",
|
|
73
|
-
"azd_template/README.md",
|
|
74
|
-
"azd_template/infra/*.bicep",
|
|
75
|
-
"azd_template/infra/*.json",
|
|
76
|
-
"azd_template/infra/modules/*.bicep",
|
|
77
|
-
"azd_template/hooks/*.ps1",
|
|
78
|
-
"azd_template/hooks/*.sh",
|
|
79
|
-
]
|
|
80
71
|
|
|
81
72
|
[tool.pytest.ini_options]
|
|
82
73
|
testpaths = ["tests"]
|
|
@@ -18,11 +18,14 @@ Resolution precedence (highest -> lowest):
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import os
|
|
21
|
-
import re
|
|
22
21
|
from dataclasses import dataclass
|
|
23
22
|
from typing import Optional
|
|
24
23
|
|
|
25
|
-
from cu_cli_core.service_options import
|
|
24
|
+
from cu_cli_core.service_options import (
|
|
25
|
+
DEFAULT_API_VERSION,
|
|
26
|
+
SUPPORTED_API_VERSIONS,
|
|
27
|
+
is_supported_api_version,
|
|
28
|
+
)
|
|
26
29
|
|
|
27
30
|
from .errors import CuCliError
|
|
28
31
|
|
|
@@ -43,8 +46,6 @@ API_VERSIONS = (
|
|
|
43
46
|
),
|
|
44
47
|
)
|
|
45
48
|
|
|
46
|
-
SUPPORTED_API_VERSIONS = tuple(item.value for item in API_VERSIONS)
|
|
47
|
-
_PREVIEW_VERSION_PATTERN = re.compile(r"^\d{4}-\d{2}-\d{2}-preview$")
|
|
48
49
|
_KNOWN_VERSION_LABELS = tuple(
|
|
49
50
|
f"{item.value} ({item.label})" for item in API_VERSIONS
|
|
50
51
|
)
|
|
@@ -68,11 +69,15 @@ def _supported_list() -> str:
|
|
|
68
69
|
|
|
69
70
|
def is_preview_version(version: Optional[str]) -> bool:
|
|
70
71
|
"""Return whether *version* has the forward-compatible preview shape."""
|
|
71
|
-
return bool(
|
|
72
|
+
return bool(
|
|
73
|
+
version
|
|
74
|
+
and version not in SUPPORTED_API_VERSIONS
|
|
75
|
+
and is_supported_api_version(version)
|
|
76
|
+
)
|
|
72
77
|
|
|
73
78
|
|
|
74
79
|
def is_supported(version: Optional[str]) -> bool:
|
|
75
|
-
return
|
|
80
|
+
return is_supported_api_version(version)
|
|
76
81
|
|
|
77
82
|
|
|
78
83
|
def ensure_supported(version: Optional[str]) -> str:
|
|
@@ -25,6 +25,7 @@ from .commands.infra import infra_group
|
|
|
25
25
|
from .commands.upgrade import cmd_upgrade
|
|
26
26
|
from .commands._help import common_commands
|
|
27
27
|
from .commands._infra_models import cmd_infra_models
|
|
28
|
+
from .commands._postprovision import cmd_postprovision_v1
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def _force_utf8_io() -> None:
|
|
@@ -132,6 +133,7 @@ main.add_command(analyzer_group)
|
|
|
132
133
|
main.add_command(defaults_group)
|
|
133
134
|
main.add_command(cmd_upgrade)
|
|
134
135
|
main.add_command(cmd_infra_models)
|
|
136
|
+
main.add_command(cmd_postprovision_v1)
|
|
135
137
|
|
|
136
138
|
|
|
137
139
|
if __name__ == "__main__":
|
|
@@ -11,12 +11,18 @@ from typing import Any
|
|
|
11
11
|
|
|
12
12
|
import rich_click as click
|
|
13
13
|
|
|
14
|
-
from cu_cli_core.command_spec import
|
|
14
|
+
from cu_cli_core.command_spec import (
|
|
15
|
+
ArgumentSpec,
|
|
16
|
+
ArgumentValueType,
|
|
17
|
+
CommandSpec,
|
|
18
|
+
SurfaceClassification,
|
|
19
|
+
)
|
|
15
20
|
|
|
16
21
|
|
|
17
22
|
_SIMPLE_CLICK_TYPES: dict[ArgumentValueType, Any] = {
|
|
18
23
|
ArgumentValueType.STRING: str,
|
|
19
24
|
ArgumentValueType.BOOLEAN: bool,
|
|
25
|
+
ArgumentValueType.TRISTATE_BOOLEAN: click.BOOL,
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
|
|
@@ -74,12 +80,17 @@ def with_command_arguments(spec: CommandSpec):
|
|
|
74
80
|
"""Attach the command-specific arguments declared by ``spec``."""
|
|
75
81
|
|
|
76
82
|
def decorate(fn: Callable[..., Any]) -> Callable[..., Any]:
|
|
83
|
+
arguments = tuple(
|
|
84
|
+
argument
|
|
85
|
+
for argument in spec.arguments
|
|
86
|
+
if argument.classification is not SurfaceClassification.AZURE_ONLY
|
|
87
|
+
)
|
|
77
88
|
fields_with_alternates = {
|
|
78
89
|
argument.field
|
|
79
|
-
for argument in
|
|
80
|
-
if sum(item.field == argument.field for item in
|
|
90
|
+
for argument in arguments
|
|
91
|
+
if sum(item.field == argument.field for item in arguments) > 1
|
|
81
92
|
}
|
|
82
|
-
for argument in reversed(
|
|
93
|
+
for argument in reversed(arguments):
|
|
83
94
|
option = (
|
|
84
95
|
_click_argument(argument)
|
|
85
96
|
if argument.positional
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import sys
|
|
9
|
-
from pathlib import Path
|
|
10
9
|
|
|
11
10
|
import rich_click as click
|
|
11
|
+
from cu_cli_core.command_spec import INFRA_MODELS
|
|
12
12
|
|
|
13
13
|
from ..client import build_client, resolve
|
|
14
14
|
from ..profile import Profile
|
|
@@ -26,6 +26,7 @@ from ..errors import CuCliError, friendly_errors
|
|
|
26
26
|
from ..output import console
|
|
27
27
|
from ._help import common_commands
|
|
28
28
|
from ._options import print_runtime_context, with_auth_options
|
|
29
|
+
from ._command_spec import with_command_arguments
|
|
29
30
|
|
|
30
31
|
NO_MODEL_ANALYZERS = (
|
|
31
32
|
"prebuilt-digitalParse",
|
|
@@ -119,13 +120,7 @@ def _client(endpoint, api_key, api_version, entra, profile_name, show_runtime_co
|
|
|
119
120
|
),
|
|
120
121
|
),
|
|
121
122
|
)
|
|
122
|
-
@
|
|
123
|
-
@click.option("--account", "account_name", required=True)
|
|
124
|
-
@click.option("--subscription", "subscription_id", required=True)
|
|
125
|
-
@click.option("--selection", required=True,
|
|
126
|
-
help="prompt, recommended, none, or comma-separated model selectors.")
|
|
127
|
-
@click.option("--out", "out_path", required=True, type=click.Path(path_type=Path))
|
|
128
|
-
@click.option("--deploy/--no-deploy", default=True)
|
|
123
|
+
@with_command_arguments(INFRA_MODELS)
|
|
129
124
|
@with_auth_options
|
|
130
125
|
@friendly_errors
|
|
131
126
|
def cmd_infra_models(
|