cognite-toolkit 0.6.114__py3-none-any.whl → 0.6.115__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.
- cognite_toolkit/_cdf_tk/apps/_upload_app.py +46 -15
- cognite_toolkit/_cdf_tk/commands/deploy.py +12 -0
- cognite_toolkit/_cdf_tk/constants.py +1 -0
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml +1 -1
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml +1 -1
- cognite_toolkit/_resources/cdf.toml +1 -1
- cognite_toolkit/_version.py +1 -1
- {cognite_toolkit-0.6.114.dist-info → cognite_toolkit-0.6.115.dist-info}/METADATA +1 -1
- {cognite_toolkit-0.6.114.dist-info → cognite_toolkit-0.6.115.dist-info}/RECORD +12 -12
- {cognite_toolkit-0.6.114.dist-info → cognite_toolkit-0.6.115.dist-info}/WHEEL +0 -0
- {cognite_toolkit-0.6.114.dist-info → cognite_toolkit-0.6.115.dist-info}/entry_points.txt +0 -0
- {cognite_toolkit-0.6.114.dist-info → cognite_toolkit-0.6.115.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Annotated, Any
|
|
3
3
|
|
|
4
|
+
import questionary
|
|
4
5
|
import typer
|
|
6
|
+
from questionary import Choice
|
|
5
7
|
|
|
6
8
|
from cognite_toolkit._cdf_tk.commands import UploadCommand
|
|
7
|
-
from cognite_toolkit._cdf_tk.constants import DATA_DEFAULT_DIR
|
|
9
|
+
from cognite_toolkit._cdf_tk.constants import DATA_DEFAULT_DIR, DATA_MANIFEST_SUFFIX, DATA_RESOURCE_DIR
|
|
8
10
|
from cognite_toolkit._cdf_tk.utils.auth import EnvironmentVariables
|
|
9
11
|
|
|
10
12
|
DEFAULT_INPUT_DIR = Path.cwd() / DATA_DEFAULT_DIR
|
|
@@ -13,21 +15,21 @@ DEFAULT_INPUT_DIR = Path.cwd() / DATA_DEFAULT_DIR
|
|
|
13
15
|
class UploadApp(typer.Typer):
|
|
14
16
|
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
15
17
|
super().__init__(*args, **kwargs)
|
|
16
|
-
self.
|
|
18
|
+
self.command("dir")(self.upload_main)
|
|
17
19
|
|
|
18
20
|
@staticmethod
|
|
19
21
|
def upload_main(
|
|
20
22
|
ctx: typer.Context,
|
|
21
23
|
input_dir: Annotated[
|
|
22
|
-
Path,
|
|
24
|
+
Path | None,
|
|
23
25
|
typer.Argument(
|
|
24
|
-
help="The directory containing the data to upload.",
|
|
26
|
+
help="The directory containing the data to upload. If not specified, an interactive prompt will ask for the directory.",
|
|
25
27
|
exists=True,
|
|
26
28
|
file_okay=False,
|
|
27
29
|
dir_okay=True,
|
|
28
30
|
resolve_path=True,
|
|
29
31
|
),
|
|
30
|
-
],
|
|
32
|
+
] = None,
|
|
31
33
|
dry_run: Annotated[
|
|
32
34
|
bool,
|
|
33
35
|
typer.Option(
|
|
@@ -43,7 +45,7 @@ class UploadApp(typer.Typer):
|
|
|
43
45
|
"-r",
|
|
44
46
|
help="If set, the command will look for resource configuration files in adjacent folders and create them if they do not exist.",
|
|
45
47
|
),
|
|
46
|
-
] =
|
|
48
|
+
] = False,
|
|
47
49
|
verbose: Annotated[
|
|
48
50
|
bool,
|
|
49
51
|
typer.Option(
|
|
@@ -55,14 +57,43 @@ class UploadApp(typer.Typer):
|
|
|
55
57
|
) -> None:
|
|
56
58
|
"""Commands to upload data to CDF."""
|
|
57
59
|
cmd = UploadCommand()
|
|
60
|
+
if input_dir is None:
|
|
61
|
+
input_candidate = sorted({p.parent for p in DEFAULT_INPUT_DIR.rglob(f"*/**{DATA_MANIFEST_SUFFIX}")})
|
|
62
|
+
if not input_candidate:
|
|
63
|
+
typer.echo(f"No data manifests found in default directory: {DEFAULT_INPUT_DIR}")
|
|
64
|
+
raise typer.Exit(code=1)
|
|
65
|
+
input_dir = questionary.select(
|
|
66
|
+
"Select the input directory containing the data to upload:",
|
|
67
|
+
choices=[Choice(str(option.name), value=option) for option in input_candidate],
|
|
68
|
+
).ask()
|
|
69
|
+
if input_dir is None:
|
|
70
|
+
typer.echo("No input directory selected. Exiting.")
|
|
71
|
+
raise typer.Exit(code=1)
|
|
72
|
+
dry_run = questionary.confirm("Proceed with dry run?", default=dry_run).ask()
|
|
73
|
+
if dry_run is None:
|
|
74
|
+
typer.echo("No selection made for dry run. Exiting.")
|
|
75
|
+
raise typer.Exit(code=1)
|
|
76
|
+
resource_dir = Path(input_dir) / DATA_RESOURCE_DIR
|
|
77
|
+
if resource_dir.exists():
|
|
78
|
+
if resource_dir.is_relative_to(Path.cwd()):
|
|
79
|
+
display_name = resource_dir.relative_to(Path.cwd()).as_posix()
|
|
80
|
+
else:
|
|
81
|
+
display_name = resource_dir.as_posix()
|
|
82
|
+
|
|
83
|
+
deploy_resources = questionary.confirm(
|
|
84
|
+
f"Deploy resources found in {display_name!r}?", default=deploy_resources
|
|
85
|
+
).ask()
|
|
86
|
+
if deploy_resources is None:
|
|
87
|
+
typer.echo("No selection made for deploying resources. Exiting.")
|
|
88
|
+
raise typer.Exit(code=1)
|
|
58
89
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
90
|
+
client = EnvironmentVariables.create_from_environment().get_client()
|
|
91
|
+
cmd.run(
|
|
92
|
+
lambda: cmd.upload(
|
|
93
|
+
input_dir=input_dir,
|
|
94
|
+
dry_run=dry_run,
|
|
95
|
+
verbose=verbose,
|
|
96
|
+
deploy_resources=deploy_resources,
|
|
97
|
+
client=client,
|
|
98
|
+
)
|
|
67
99
|
)
|
|
68
|
-
)
|
|
@@ -15,6 +15,7 @@ from cognite_toolkit._cdf_tk.commands.clean import CleanCommand
|
|
|
15
15
|
from cognite_toolkit._cdf_tk.constants import (
|
|
16
16
|
_RUNNING_IN_BROWSER,
|
|
17
17
|
BUILD_ENVIRONMENT_FILE,
|
|
18
|
+
DATA_UPLOAD_URL,
|
|
18
19
|
HINT_LEAD_TEXT,
|
|
19
20
|
)
|
|
20
21
|
from cognite_toolkit._cdf_tk.cruds import (
|
|
@@ -43,6 +44,7 @@ from cognite_toolkit._cdf_tk.exceptions import (
|
|
|
43
44
|
ToolkitFileNotFoundError,
|
|
44
45
|
ToolkitNotADirectoryError,
|
|
45
46
|
)
|
|
47
|
+
from cognite_toolkit._cdf_tk.feature_flags import Flags
|
|
46
48
|
from cognite_toolkit._cdf_tk.protocols import (
|
|
47
49
|
T_ResourceRequest,
|
|
48
50
|
T_ResourceRequestList,
|
|
@@ -52,6 +54,7 @@ from cognite_toolkit._cdf_tk.protocols import (
|
|
|
52
54
|
from cognite_toolkit._cdf_tk.tk_warnings import EnvironmentVariableMissingWarning
|
|
53
55
|
from cognite_toolkit._cdf_tk.tk_warnings.base import WarningList, catch_warnings
|
|
54
56
|
from cognite_toolkit._cdf_tk.tk_warnings.other import (
|
|
57
|
+
HighSeverityWarning,
|
|
55
58
|
LowSeverityWarning,
|
|
56
59
|
ToolkitDependenciesIncludedWarning,
|
|
57
60
|
)
|
|
@@ -292,6 +295,15 @@ class DeployCommand(ToolkitCommand):
|
|
|
292
295
|
read_modules = build.read_modules
|
|
293
296
|
output_results = DeployResults([], "deploy", dry_run=dry_run) if results is None else results
|
|
294
297
|
for loader_cls in ordered_loaders:
|
|
298
|
+
if issubclass(loader_cls, DataCRUD) and Flags.v07:
|
|
299
|
+
self.warn(
|
|
300
|
+
HighSeverityWarning(
|
|
301
|
+
f"Uploading {loader_cls.kind} data is deprecated and will be removed in v0.8. "
|
|
302
|
+
f"Use the `cdf data upload dir` command instead. See [{DATA_UPLOAD_URL}]({DATA_UPLOAD_URL}) for more information about "
|
|
303
|
+
"the upload command."
|
|
304
|
+
)
|
|
305
|
+
)
|
|
306
|
+
|
|
295
307
|
loader = loader_cls.create_loader(client, build_dir)
|
|
296
308
|
resource_result: DeployResult | None
|
|
297
309
|
if isinstance(loader, ResourceCRUD):
|
|
@@ -178,6 +178,7 @@ DATA_RESOURCE_DIR = "resources"
|
|
|
178
178
|
DATA_MANIFEST_STEM = "Manifest"
|
|
179
179
|
DATA_MANIFEST_SUFFIX = f".{DATA_MANIFEST_STEM}.yaml"
|
|
180
180
|
|
|
181
|
+
DATA_UPLOAD_URL = "https://docs.cognite.com/cdf/deploy/cdf_toolkit/guides/plugins/data_plugin/index"
|
|
181
182
|
# Migration Constants
|
|
182
183
|
MISSING_INSTANCE_SPACE = "<InstanceSpaceMissing>"
|
|
183
184
|
MISSING_EXTERNAL_ID = "INTERNAL_ID_project_{project}_id_{id}"
|
|
@@ -4,7 +4,7 @@ default_env = "<DEFAULT_ENV_PLACEHOLDER>"
|
|
|
4
4
|
[modules]
|
|
5
5
|
# This is the version of the modules. It should not be changed manually.
|
|
6
6
|
# It will be updated by the 'cdf modules upgrade' command.
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.115"
|
|
8
8
|
|
|
9
9
|
[alpha_flags]
|
|
10
10
|
external-libraries = true
|
cognite_toolkit/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.6.
|
|
1
|
+
__version__ = "0.6.115"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite_toolkit
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.115
|
|
4
4
|
Summary: Official Cognite Data Fusion tool for project templates and configuration deployment
|
|
5
5
|
Project-URL: Homepage, https://docs.cognite.com/cdf/deploy/cdf_toolkit/
|
|
6
6
|
Project-URL: Changelog, https://github.com/cognitedata/toolkit/releases
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
cognite_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
cognite_toolkit/_cdf.py,sha256=qr31QC3AhJukM-9rBeWHBTLuNU01XIXAtV5dzqOU3iA,5958
|
|
3
|
-
cognite_toolkit/_version.py,sha256=
|
|
3
|
+
cognite_toolkit/_version.py,sha256=Z89ggLJjU4yNR7PZQ8iPexZJTOjFTQDJaPNdozHGQjA,24
|
|
4
4
|
cognite_toolkit/_cdf_tk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite_toolkit/_cdf_tk/cdf_toml.py,sha256=VSWV9h44HusWIaKpWgjrOMrc3hDoPTTXBXlp6-NOrIM,9079
|
|
6
|
-
cognite_toolkit/_cdf_tk/constants.py,sha256=
|
|
6
|
+
cognite_toolkit/_cdf_tk/constants.py,sha256=3UpFZ60xXdqgPqqpqCITQuAvjnVExH_IlbASxoelvu8,7236
|
|
7
7
|
cognite_toolkit/_cdf_tk/exceptions.py,sha256=xG0jMwi5A20nvPvyo6sCyz_cyKycynPyIzpYiGR4gcU,6064
|
|
8
8
|
cognite_toolkit/_cdf_tk/feature_flags.py,sha256=TjwUmGG5qXBQ-8P1ongh2qQnuRfVRvGaP1JBtuUot88,3106
|
|
9
9
|
cognite_toolkit/_cdf_tk/hints.py,sha256=UI1ymi2T5wCcYOpEbKbVaDnlyFReFy8TDtMVt-5E1h8,6493
|
|
@@ -25,7 +25,7 @@ cognite_toolkit/_cdf_tk/apps/_profile_app.py,sha256=vSRJW54bEvIul8_4rOqyOYA7ztXx
|
|
|
25
25
|
cognite_toolkit/_cdf_tk/apps/_purge.py,sha256=e8IgDK2Fib2u30l71Q2trbJ1az90zSLWr5TViTINmL0,15415
|
|
26
26
|
cognite_toolkit/_cdf_tk/apps/_repo_app.py,sha256=jOf_s7oUWJqnRyz89JFiSzT2l8GlyQ7wqidHUQavGo0,1455
|
|
27
27
|
cognite_toolkit/_cdf_tk/apps/_run.py,sha256=9tn3o9iWtCP85KcLmnytIaIB_cj1EegtEm51r85Sl44,9082
|
|
28
|
-
cognite_toolkit/_cdf_tk/apps/_upload_app.py,sha256=
|
|
28
|
+
cognite_toolkit/_cdf_tk/apps/_upload_app.py,sha256=LPv3iQJTMDo2cq4Ev26DGguqPd3LjySw9FXrG1iRGU0,3942
|
|
29
29
|
cognite_toolkit/_cdf_tk/builders/__init__.py,sha256=Y-AJ4VrcUCRquGNEgDCiwmWW3iGWnJl2DrL17gsUIBg,1172
|
|
30
30
|
cognite_toolkit/_cdf_tk/builders/_base.py,sha256=N32Y17hfepp45rMW_o4qeUY9nsysmtcxpX4GkF-tsio,7829
|
|
31
31
|
cognite_toolkit/_cdf_tk/builders/_datamodels.py,sha256=hN3fWQAktrWdaGAItZ0tHpBXqJDu0JfH6t7pO7EIl2Q,3541
|
|
@@ -115,7 +115,7 @@ cognite_toolkit/_cdf_tk/commands/auth.py,sha256=PLjfxfJJKaqux1eB2fycIRlwwSMCbM3q
|
|
|
115
115
|
cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=ppaSstd4zd5ZLcwwU9ueg3kH6MflxOL7DXnDuGAcbcY,31007
|
|
116
116
|
cognite_toolkit/_cdf_tk/commands/clean.py,sha256=KDcUn1MEpvk_K7WqQPBiZcIlGV61JVG6D0DcYUXj7BM,16567
|
|
117
117
|
cognite_toolkit/_cdf_tk/commands/collect.py,sha256=zBMKhhvjOpuASMnwP0eeHRI02tANcvFEZgv0CQO1ECc,627
|
|
118
|
-
cognite_toolkit/_cdf_tk/commands/deploy.py,sha256=
|
|
118
|
+
cognite_toolkit/_cdf_tk/commands/deploy.py,sha256=YV_GcD5bbELlXMixoVoCA2W4mcwHej_6jvb9J8JBQd0,23589
|
|
119
119
|
cognite_toolkit/_cdf_tk/commands/dump_data.py,sha256=8l4M2kqV4DjiV5js5s7EbFVNxV0Np4ld8ogw19vaJp0,21804
|
|
120
120
|
cognite_toolkit/_cdf_tk/commands/dump_resource.py,sha256=ylAFST3GgkWT1Qa-JIzmQXbrQgNCB1UrptrBf3WsyvY,39658
|
|
121
121
|
cognite_toolkit/_cdf_tk/commands/featureflag.py,sha256=lgLMwuNIwFjvvKn1sNMunkq4VTwdNqXtrZfdGFTrNcI,968
|
|
@@ -302,13 +302,13 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
|
|
|
302
302
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
|
|
303
303
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
|
|
304
304
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
|
|
305
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=
|
|
306
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=
|
|
307
|
-
cognite_toolkit/_resources/cdf.toml,sha256=
|
|
305
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=PjN9SjPDdv1gpMbLk4BENfZSsfvk1FcYm09Wi-GGoR0,668
|
|
306
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=7tIIyJNaWWVKWPUs6s4oSpsBBs14c1UzOSy-VpOn638,2431
|
|
307
|
+
cognite_toolkit/_resources/cdf.toml,sha256=QLuQRCrDWpi6Z_YIAkV9LySofdxFW86-2YztdKmxUZw,488
|
|
308
308
|
cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
|
|
309
309
|
cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
|
|
310
|
-
cognite_toolkit-0.6.
|
|
311
|
-
cognite_toolkit-0.6.
|
|
312
|
-
cognite_toolkit-0.6.
|
|
313
|
-
cognite_toolkit-0.6.
|
|
314
|
-
cognite_toolkit-0.6.
|
|
310
|
+
cognite_toolkit-0.6.115.dist-info/METADATA,sha256=F2AdvNhKV2uNNLV94cAmf1rq0Bj_huntJkH2OuoUqBQ,4502
|
|
311
|
+
cognite_toolkit-0.6.115.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
312
|
+
cognite_toolkit-0.6.115.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
|
|
313
|
+
cognite_toolkit-0.6.115.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
|
|
314
|
+
cognite_toolkit-0.6.115.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|