cmem-cmemc 24.1.0__tar.gz → 24.1.1__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.
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/PKG-INFO +2 -2
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/__init__.py +2 -1
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/__init__.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/admin.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/config.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/dataset.py +2 -1
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/graph.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/project.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/python.py +5 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/query.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/resource.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/scheduler.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/store.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/user.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/validation.py +2 -1
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/variable.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/vocabulary.py +9 -8
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/workflow.py +3 -2
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/workspace.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/completion.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/constants.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/context.py +15 -9
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/manual_helper/graph.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/manual_helper/multi_page.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/object_list.py +1 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/utils.py +3 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/pyproject.toml +3 -3
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/LICENSE +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/README-public.md +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/_cmemc.zsh +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/acl.py +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/client.py +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/commands/metrics.py +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/exceptions.py +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/manual_helper/__init__.py +0 -0
- {cmem_cmemc-24.1.0 → cmem_cmemc-24.1.1}/cmem_cmemc/manual_helper/single_page.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cmem-cmemc
|
|
3
|
-
Version: 24.1.
|
|
3
|
+
Version: 24.1.1
|
|
4
4
|
Summary: Command line client for eccenca Corporate Memory
|
|
5
5
|
Home-page: https://eccenca.com/go/cmemc
|
|
6
6
|
License: Apache 2.0
|
|
@@ -26,7 +26,7 @@ Requires-Dist: certifi (>=2023.5.7)
|
|
|
26
26
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
27
27
|
Requires-Dist: click-didyoumean (>=0.3.0,<0.4.0)
|
|
28
28
|
Requires-Dist: click-help-colors (>=0.9.1,<0.10.0)
|
|
29
|
-
Requires-Dist: cmem-cmempy (==24.1.
|
|
29
|
+
Requires-Dist: cmem-cmempy (==24.1.1)
|
|
30
30
|
Requires-Dist: configparser (>=5.3.0,<6.0.0)
|
|
31
31
|
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
|
32
32
|
Requires-Dist: natsort (>=8.3.1,<9.0.0)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""The main command line interface."""
|
|
2
|
+
|
|
2
3
|
import contextlib
|
|
3
4
|
import os
|
|
4
5
|
import sys
|
|
@@ -100,7 +101,7 @@ def cli(
|
|
|
100
101
|
|
|
101
102
|
https://eccenca.com/go/cmemc
|
|
102
103
|
|
|
103
|
-
cmemc is ©
|
|
104
|
+
cmemc is © 2024 eccenca GmbH, licensed under the Apache License 2.0.
|
|
104
105
|
"""
|
|
105
106
|
ctx.obj = CONTEXT
|
|
106
107
|
# hidden feature: 'CMEMC_MANUAL=true cmemc -q config list' will output
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""dataset commands for cmem command line interface."""
|
|
2
|
+
|
|
2
3
|
import json
|
|
3
4
|
import re
|
|
4
5
|
from pathlib import Path
|
|
@@ -284,7 +285,7 @@ def _check_or_set_dataset_type(
|
|
|
284
285
|
|
|
285
286
|
"""
|
|
286
287
|
source = Path(dataset_file).name if dataset_file else ""
|
|
287
|
-
target = parameter_dict
|
|
288
|
+
target = parameter_dict.get("file", "")
|
|
288
289
|
suggestions = (
|
|
289
290
|
(".ttl", "file"),
|
|
290
291
|
(".csv", "csv"),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""DataIntegration python management commands."""
|
|
2
|
+
|
|
2
3
|
import sys
|
|
3
4
|
from dataclasses import asdict
|
|
4
5
|
from re import match
|
|
@@ -49,6 +50,10 @@ def install_command(app: ApplicationContext, package: str) -> None:
|
|
|
49
50
|
.tar.gz file, by uploading a build distribution .whl file, or by
|
|
50
51
|
specifying a package name, i.e., a pip requirement specifier with a
|
|
51
52
|
package name available on pypi.org (e.g. `requests==2.27.1`).
|
|
53
|
+
|
|
54
|
+
Note: The tab-completion of this command lists only public packages from
|
|
55
|
+
pypi.org and not from additional or changed python package repositories you
|
|
56
|
+
may have configured on the server.
|
|
52
57
|
"""
|
|
53
58
|
app.echo_info(f"Install package {package} ... ", nl=False)
|
|
54
59
|
try:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""graph validation command group"""
|
|
2
|
+
|
|
2
3
|
import time
|
|
3
4
|
from datetime import UTC, datetime
|
|
4
5
|
|
|
@@ -295,7 +296,7 @@ def _get_resource_count(batch_validation: dict) -> str:
|
|
|
295
296
|
|
|
296
297
|
def _get_violation_count(process_data: dict) -> str:
|
|
297
298
|
"""Get violation count from validation report"""
|
|
298
|
-
if process_data.get("executionStarted"
|
|
299
|
+
if process_data.get("executionStarted") is None:
|
|
299
300
|
return "-"
|
|
300
301
|
resources = str(process_data.get("resourcesWithViolationsCount", "0"))
|
|
301
302
|
violations = str(process_data.get("violationsCount", "0"))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""vocabularies commands for cmem command line interface."""
|
|
2
|
+
|
|
2
3
|
import io
|
|
3
4
|
from datetime import UTC, datetime
|
|
4
5
|
from re import match
|
|
@@ -150,7 +151,7 @@ def _insert_catalog_entry(iri: str, prefix: str, namespace: str, label: str, lan
|
|
|
150
151
|
|
|
151
152
|
|
|
152
153
|
def _get_vocabulary_metadata_from_file(
|
|
153
|
-
file: io.
|
|
154
|
+
file: io.BytesIO, namespace_given: bool = False
|
|
154
155
|
) -> dict[str, str]:
|
|
155
156
|
"""Get potential graph iri and prefix/namespace from a turtle file."""
|
|
156
157
|
metadata = {"iri": "", "prefix": "", "namespace": ""}
|
|
@@ -345,19 +346,19 @@ def import_command(
|
|
|
345
346
|
description which correctly uses the `vann:preferredNamespacePrefix` and
|
|
346
347
|
`vann:preferredNamespaceUri` properties.
|
|
347
348
|
"""
|
|
348
|
-
|
|
349
|
+
_buffer = io.BytesIO()
|
|
349
350
|
with click.open_file(file, "rb") as file_handle:
|
|
350
|
-
|
|
351
|
-
|
|
351
|
+
_buffer.write(file_handle.read())
|
|
352
|
+
_buffer.seek(0)
|
|
352
353
|
|
|
353
354
|
# fetch metadata
|
|
354
355
|
if namespace != (None, None):
|
|
355
356
|
_validate_namespace(app, namespace)
|
|
356
|
-
meta_data = _get_vocabulary_metadata_from_file(
|
|
357
|
+
meta_data = _get_vocabulary_metadata_from_file(_buffer, True)
|
|
357
358
|
meta_data["prefix"] = namespace[0] # type: ignore[assignment]
|
|
358
359
|
meta_data["namespace"] = namespace[1] # type: ignore[assignment]
|
|
359
360
|
else:
|
|
360
|
-
meta_data = _get_vocabulary_metadata_from_file(
|
|
361
|
+
meta_data = _get_vocabulary_metadata_from_file(_buffer, False)
|
|
361
362
|
iri = meta_data["iri"]
|
|
362
363
|
|
|
363
364
|
success_message = "done"
|
|
@@ -368,8 +369,8 @@ def import_command(
|
|
|
368
369
|
raise ValueError(f"Proposed graph {iri} does already exist.")
|
|
369
370
|
app.echo_info(f"Import {file} as vocabulary to {iri} ... ", nl=False)
|
|
370
371
|
# upload graph
|
|
371
|
-
|
|
372
|
-
graph_api.post_streamed(iri,
|
|
372
|
+
_buffer.seek(0)
|
|
373
|
+
graph_api.post_streamed(iri, _buffer, replace=True)
|
|
373
374
|
|
|
374
375
|
# resolve label
|
|
375
376
|
resolved_label_object: dict = resolve([iri], graph=iri)[iri]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""workflow commands for cmem command line interface."""
|
|
2
|
+
|
|
2
3
|
import re
|
|
3
4
|
import sys
|
|
4
5
|
import time
|
|
@@ -338,9 +339,9 @@ def _workflow_echo_status(app: ApplicationContext, status: dict) -> None:
|
|
|
338
339
|
f"statusName is {status_name}, expecting one of: " "Running, Canceling or Waiting."
|
|
339
340
|
)
|
|
340
341
|
# not running can be Idle or Finished
|
|
341
|
-
if
|
|
342
|
+
if status.get("failed"):
|
|
342
343
|
app.echo_error(message, nl=True, err=False)
|
|
343
|
-
elif
|
|
344
|
+
elif status.get("cancelled"):
|
|
344
345
|
app.echo_warning(message)
|
|
345
346
|
elif status["statusName"] == "Idle":
|
|
346
347
|
app.echo_info(message)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""The main command line interface."""
|
|
2
|
+
|
|
2
3
|
import ast
|
|
3
4
|
import configparser
|
|
4
5
|
import json
|
|
@@ -21,12 +22,13 @@ from pygments.lexers import get_lexer_by_name
|
|
|
21
22
|
from rich import box
|
|
22
23
|
from rich.console import Console
|
|
23
24
|
from rich.table import Table
|
|
25
|
+
from urllib3.exceptions import InsecureRequestWarning
|
|
24
26
|
|
|
25
27
|
from cmem_cmemc.exceptions import InvalidConfigurationError
|
|
26
28
|
|
|
27
|
-
DI_TARGET_VERSION = "
|
|
29
|
+
DI_TARGET_VERSION = "v24.1.0"
|
|
28
30
|
|
|
29
|
-
DP_TARGET_VERSION = "
|
|
31
|
+
DP_TARGET_VERSION = "v24.1.0"
|
|
30
32
|
|
|
31
33
|
KNOWN_CONFIG_KEYS = {
|
|
32
34
|
"CMEM_BASE_URI": cmempy_config.get_cmem_base_uri,
|
|
@@ -47,6 +49,8 @@ KNOWN_CONFIG_KEYS = {
|
|
|
47
49
|
|
|
48
50
|
KNOWN_SECRET_KEYS = ("OAUTH_PASSWORD", "OAUTH_CLIENT_SECRET", "OAUTH_ACCESS_TOKEN")
|
|
49
51
|
|
|
52
|
+
SSL_VERIFY_WARNING = "SSL verification is disabled (SSL_VERIFY=False)."
|
|
53
|
+
|
|
50
54
|
|
|
51
55
|
class ApplicationContext:
|
|
52
56
|
"""Context of the command line interface."""
|
|
@@ -142,12 +146,6 @@ class ApplicationContext:
|
|
|
142
146
|
self.set_credential_from_process(_, _ + "_PROCESS", config)
|
|
143
147
|
|
|
144
148
|
self.echo_debug(f"CA bundle loaded from {cmempy_config.get_requests_ca_bundle()}")
|
|
145
|
-
# If cert validation is disabled, output a warning
|
|
146
|
-
# Also disable library warnings:
|
|
147
|
-
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html
|
|
148
|
-
if not cmempy_config.get_ssl_verify():
|
|
149
|
-
self.echo_warning("SSL verification is disabled (SSL_VERIFY=False).")
|
|
150
|
-
urllib3.disable_warnings()
|
|
151
149
|
return
|
|
152
150
|
|
|
153
151
|
def set_connection_from_params(self, params: dict) -> None:
|
|
@@ -192,7 +190,7 @@ class ApplicationContext:
|
|
|
192
190
|
self.config = self.get_config()
|
|
193
191
|
self.connection = None
|
|
194
192
|
if section_string is None or section_string == "":
|
|
195
|
-
self.echo_debug("No config given, use API
|
|
193
|
+
self.echo_debug("No config given, use API defaults or environment connection.")
|
|
196
194
|
elif section_string not in self.config:
|
|
197
195
|
raise InvalidConfigurationError(
|
|
198
196
|
f"There is no connection '{section_string}' configured in "
|
|
@@ -202,6 +200,14 @@ class ApplicationContext:
|
|
|
202
200
|
self.echo_debug(f"Use connection config: {section_string}")
|
|
203
201
|
self.connection = self.config[section_string]
|
|
204
202
|
self.configure_cmempy(self.connection)
|
|
203
|
+
|
|
204
|
+
# If cert validation is disabled, output a warning
|
|
205
|
+
# Also disable library warnings:
|
|
206
|
+
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
|
|
207
|
+
if not cmempy_config.get_ssl_verify():
|
|
208
|
+
self.echo_warning(SSL_VERIFY_WARNING)
|
|
209
|
+
urllib3.disable_warnings(category=InsecureRequestWarning)
|
|
210
|
+
|
|
205
211
|
return self.connection
|
|
206
212
|
|
|
207
213
|
def get_config_file(self) -> Path:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Utility functions for CLI interface."""
|
|
2
|
+
|
|
2
3
|
import json
|
|
3
4
|
import os
|
|
4
5
|
import re
|
|
@@ -295,6 +296,8 @@ def get_published_packages() -> list[PublishedPackage]:
|
|
|
295
296
|
name = _.findChildren(class_="package-snippet__name")[0].getText()
|
|
296
297
|
if name == "cmem-plugin-base":
|
|
297
298
|
continue
|
|
299
|
+
if not name.startswith("cmem-plugin-"):
|
|
300
|
+
continue
|
|
298
301
|
description = _.findChildren(class_="package-snippet__description")[0].getText()
|
|
299
302
|
package_version = _.findChildren(class_="package-snippet__version")[0].getText()
|
|
300
303
|
published = _.findChildren(name="time")[0].attrs["datetime"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cmem-cmemc"
|
|
3
|
-
version = "24.1.
|
|
3
|
+
version = "24.1.1"
|
|
4
4
|
description = "Command line client for eccenca Corporate Memory"
|
|
5
5
|
license = "Apache 2.0"
|
|
6
6
|
classifiers = ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Testing", "Topic :: Database", "Topic :: Utilities"]
|
|
@@ -15,7 +15,7 @@ certifi = ">=2023.5.7"
|
|
|
15
15
|
click = "^8.1.7"
|
|
16
16
|
click-didyoumean = "^0.3.0"
|
|
17
17
|
click-help-colors = "^0.9.1"
|
|
18
|
-
cmem-cmempy = "==24.1.
|
|
18
|
+
cmem-cmempy = "==24.1.1"
|
|
19
19
|
# cmem-cmempy = { path = "cmempy", develop = true }
|
|
20
20
|
configparser = "^5.3.0"
|
|
21
21
|
jinja2 = "^3.1.2"
|
|
@@ -42,7 +42,7 @@ pytest = "^7.3.1"
|
|
|
42
42
|
pytest-cov = "^4.1.0"
|
|
43
43
|
pytest-dotenv = "^0.5.2"
|
|
44
44
|
pytest-memray = { version = "^1.5.0", markers = "platform_system != 'Windows'" }
|
|
45
|
-
ruff = "^0.
|
|
45
|
+
ruff = "^0.3.4"
|
|
46
46
|
safety = "^1.10.3"
|
|
47
47
|
types-requests = "^2.31.0.10"
|
|
48
48
|
types-six = "^1.16.21.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|