shellsmith 0.2.0__tar.gz → 0.2.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.
Files changed (37) hide show
  1. {shellsmith-0.2.0/src/shellsmith.egg-info → shellsmith-0.2.1}/PKG-INFO +1 -1
  2. {shellsmith-0.2.0 → shellsmith-0.2.1}/pyproject.toml +1 -1
  3. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/__init__.py +1 -1
  4. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/info.py +10 -5
  5. {shellsmith-0.2.0 → shellsmith-0.2.1/src/shellsmith.egg-info}/PKG-INFO +1 -1
  6. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_neo4j.py +21 -11
  7. {shellsmith-0.2.0 → shellsmith-0.2.1}/LICENSE +0 -0
  8. {shellsmith-0.2.0 → shellsmith-0.2.1}/README.md +0 -0
  9. {shellsmith-0.2.0 → shellsmith-0.2.1}/setup.cfg +0 -0
  10. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/__main__.py +0 -0
  11. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/__init__.py +0 -0
  12. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/__init__.py +0 -0
  13. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/nuke.py +0 -0
  14. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/shell.py +0 -0
  15. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/sme.py +0 -0
  16. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/submodel.py +0 -0
  17. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/commands/upload.py +0 -0
  18. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/main.py +0 -0
  19. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/cli/parser.py +0 -0
  20. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/config.py +0 -0
  21. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/crud/__init__.py +0 -0
  22. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/crud/shells.py +0 -0
  23. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/crud/submodels.py +0 -0
  24. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/neo4j.py +0 -0
  25. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/services.py +0 -0
  26. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/upload.py +0 -0
  27. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith/utils.py +0 -0
  28. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith.egg-info/SOURCES.txt +0 -0
  29. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith.egg-info/dependency_links.txt +0 -0
  30. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith.egg-info/entry_points.txt +0 -0
  31. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith.egg-info/requires.txt +0 -0
  32. {shellsmith-0.2.0 → shellsmith-0.2.1}/src/shellsmith.egg-info/top_level.txt +0 -0
  33. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_cli.py +0 -0
  34. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_cli_integration.py +0 -0
  35. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_crud.py +0 -0
  36. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_upload.py +0 -0
  37. {shellsmith-0.2.0 → shellsmith-0.2.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shellsmith
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A Python toolkit and CLI for managing Asset Administration Shells
5
5
  Author-email: Peter Stein <peterstein@dfki.de>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "shellsmith"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "A Python toolkit and CLI for managing Asset Administration Shells"
9
9
  authors = [{ name = "Peter Stein", email = "peterstein@dfki.de" }]
10
10
  license = { file = "LICENSE" }
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.1"
2
2
 
3
3
  from .crud.shells import ( # noqa: F401
4
4
  delete_shell,
@@ -17,21 +17,25 @@ def print_unreferenced_submodels():
17
17
  print("⚠️ Unreferenced Submodels:")
18
18
  for submodel_id in submodel_ids:
19
19
  submodel = shellsmith.get_submodel(submodel_id)
20
- id_short = submodel["idShort"]
20
+ id_short = submodel.get("idShort", "<no idShort>")
21
21
  print(f"- {id_short} ({submodel_id})")
22
22
 
23
23
 
24
24
  def print_shells_tree():
25
25
  shells = shellsmith.get_shells()
26
26
  for shell in shells:
27
- print(f"{shell['idShort']}: {shell['id']}")
27
+ shell_id = shell['id']
28
+ shell_id_short = shell.get('idShort', "<no idShort>")
29
+ print(f"{shell_id_short}: {shell_id}")
28
30
 
29
- submodels = services.get_shell_submodels(shell["id"])
31
+ submodels = services.get_shell_submodels(shell_id)
30
32
 
31
33
  for i, submodel in enumerate(submodels):
32
34
  is_last = i == len(submodels) - 1
33
35
  prefix = "└──" if is_last else "├──"
34
- print(f"{prefix} {submodel['idShort']}: {submodel['id']}")
36
+ submodel_id = submodel['id']
37
+ submodel_id_short = submodel.get('idShort', "<no idShort>")
38
+ print(f"{prefix} {submodel_id}: {submodel_id_short}")
35
39
 
36
40
 
37
41
  def print_dangling_submodel_refs():
@@ -42,6 +46,7 @@ def print_dangling_submodel_refs():
42
46
  print("⚠️ Dangling Submodel References:")
43
47
  for shell_id, submodel_ids in dangling.items():
44
48
  shell = shellsmith.get_shell(shell_id)
45
- print(f"- {shell['idShort']}: {shell_id}")
49
+ shell_id_short = shell.get('idShort', "<no idShort>")
50
+ print(f"- {shell_id_short}: {shell_id}")
46
51
  for submodel_id in submodel_ids:
47
52
  print(f" └── {submodel_id}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shellsmith
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A Python toolkit and CLI for managing Asset Administration Shells
5
5
  Author-email: Peter Stein <peterstein@dfki.de>
6
6
  License: MIT License
@@ -3,16 +3,17 @@ import time
3
3
 
4
4
  import pytest
5
5
 
6
- from shellsmith import neo4j
7
- from shellsmith.upload import upload_aas_folder
8
-
9
6
  if not os.getenv("SHELLSMITH_NEO4J_ENABLED"):
10
7
  pytest.skip(
11
8
  reason="Skipping Neo4j tests. Set SHELLSMITH_NEO4J_ENABLED=1 to enable.",
12
9
  allow_module_level=True,
13
10
  )
14
11
 
15
- GRAPH_READY_TIMEOUT = 15 # seconds
12
+ from shellsmith import neo4j, services
13
+ from shellsmith.upload import upload_aas_folder
14
+
15
+
16
+ GRAPH_READY_TIMEOUT = 45 # seconds
16
17
  EXPECTED_NODE_COUNT = 39
17
18
  EXPECTED_SUBMODEL_ELEMENT_COUNT = 17 # or whatever your total is
18
19
 
@@ -20,31 +21,40 @@ EXPECTED_SUBMODEL_ELEMENT_COUNT = 17 # or whatever your total is
20
21
  def wait_for_graph_node_count(
21
22
  expected_count: int = EXPECTED_NODE_COUNT,
22
23
  timeout: int = GRAPH_READY_TIMEOUT,
23
- ) -> bool:
24
+ ) -> (bool, int):
24
25
  query = "MATCH (n) RETURN count(n) AS count"
25
26
  start = time.time()
26
27
 
28
+ last_count = 0
29
+
27
30
  while True:
28
31
  try:
29
32
  with neo4j.get_driver().session() as session:
30
33
  result = session.run(query)
31
34
  record = result.single()
32
- if record and record["count"] == expected_count:
33
- return True
35
+ count = record["count"]
36
+ last_count = count
37
+ if record and count == expected_count:
38
+ return True, last_count
34
39
  except Exception: # noqa
35
40
  pass # wait and retry
36
41
 
37
42
  if time.time() - start > timeout:
38
- return False
43
+ return False, last_count
39
44
 
40
45
  time.sleep(0.5)
41
46
 
42
47
 
43
48
  def test_wait_for_graph():
44
- neo4j.detach_delete_all()
45
- assert wait_for_graph_node_count(0), "Graph was not fully destructed within timeout"
49
+ # neo4j.detach_delete_all()
50
+ services.delete_all_shells()
51
+ services.delete_all_submodels()
52
+ success, count = wait_for_graph_node_count(0)
53
+ assert success, f"Graph was not fully destructed within timeout: {count}"
54
+
46
55
  upload_aas_folder("aas")
47
- assert wait_for_graph_node_count(39), "Graph was not fully built within timeout"
56
+ success, count = wait_for_graph_node_count(39)
57
+ assert success, f"Graph was not fully built within timeout: {count}"
48
58
  time.sleep(1)
49
59
 
50
60
 
File without changes
File without changes
File without changes
File without changes