robotcode-debugger 0.78.4__tar.gz → 0.79.0__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 (22) hide show
  1. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/PKG-INFO +3 -3
  2. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/pyproject.toml +2 -2
  3. robotcode_debugger-0.79.0/src/robotcode/debugger/__version__.py +1 -0
  4. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/listeners.py +20 -10
  5. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/protocol.py +3 -3
  6. robotcode_debugger-0.78.4/src/robotcode/debugger/__version__.py +0 -1
  7. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/.gitignore +0 -0
  8. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/LICENSE.txt +0 -0
  9. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/README.md +0 -0
  10. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/__init__.py +0 -0
  11. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/cli.py +0 -0
  12. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/dap_types.py +0 -0
  13. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/debugger.py +0 -0
  14. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/hooks.py +0 -0
  15. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/launcher/__init__.py +0 -0
  16. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/launcher/cli.py +0 -0
  17. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/launcher/client.py +0 -0
  18. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/launcher/run.py +0 -0
  19. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/launcher/server.py +0 -0
  20. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/py.typed +0 -0
  21. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/run.py +2 -2
  22. {robotcode_debugger-0.78.4 → robotcode_debugger-0.79.0}/src/robotcode/debugger/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotcode-debugger
3
- Version: 0.78.4
3
+ Version: 0.79.0
4
4
  Summary: RobotCode Debugger for Robot Framework
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://github.com/sponsors/d-biehl
@@ -25,8 +25,8 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
25
25
  Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
27
  Requires-Python: >=3.8
28
- Requires-Dist: robotcode-jsonrpc2==0.78.4
29
- Requires-Dist: robotcode-runner==0.78.4
28
+ Requires-Dist: robotcode-jsonrpc2==0.79.0
29
+ Requires-Dist: robotcode-runner==0.79.0
30
30
  Requires-Dist: robotframework>=4.1.0
31
31
  Provides-Extra: debugpy
32
32
  Requires-Dist: debugpy; extra == 'debugpy'
@@ -28,8 +28,8 @@ classifiers = [
28
28
  dynamic = ["version"]
29
29
  dependencies = [
30
30
  "robotframework>=4.1.0",
31
- "robotcode-jsonrpc2==0.78.4",
32
- "robotcode-runner==0.78.4",
31
+ "robotcode-jsonrpc2==0.79.0",
32
+ "robotcode-runner==0.79.0",
33
33
  ]
34
34
 
35
35
  [project.optional-dependencies]
@@ -0,0 +1 @@
1
+ __version__ = "0.79.0"
@@ -6,6 +6,8 @@ from typing import Any, Dict, Iterator, List, Optional, Union, cast
6
6
  from robot import result, running
7
7
  from robot.model import Message
8
8
 
9
+ from robotcode.core.utils.path import normalized_path
10
+
9
11
  from .dap_types import Event, Model
10
12
  from .debugger import Debugger
11
13
 
@@ -18,6 +20,14 @@ class RobotExecutionEventBody(Model):
18
20
  failed_keywords: Optional[List[Dict[str, Any]]] = None
19
21
 
20
22
 
23
+ def source_from_attributes(attributes: Dict[str, Any]) -> str:
24
+ s = attributes.get("source", "")
25
+ if s:
26
+ return str(normalized_path(Path(s)))
27
+
28
+ return s or ""
29
+
30
+
21
31
  class ListenerV2:
22
32
  ROBOT_LISTENER_API_VERSION = "2"
23
33
 
@@ -32,7 +42,7 @@ class ListenerV2:
32
42
  event="robotStarted",
33
43
  body=RobotExecutionEventBody(
34
44
  type="suite",
35
- id=f"{attributes.get('source', '')};{attributes.get('longname', '')}",
45
+ id=f"{source_from_attributes(attributes)};{attributes.get('longname', '')}",
36
46
  attributes=dict(attributes),
37
47
  ),
38
48
  ),
@@ -54,7 +64,7 @@ class ListenerV2:
54
64
  body=RobotExecutionEventBody(
55
65
  type="suite",
56
66
  attributes=dict(attributes),
57
- id=f"{attributes.get('source', '')};{attributes.get('longname', '')}",
67
+ id=f"{source_from_attributes(attributes)};{attributes.get('longname', '')}",
58
68
  failed_keywords=self.failed_keywords,
59
69
  ),
60
70
  ),
@@ -71,7 +81,7 @@ class ListenerV2:
71
81
  event="robotStarted",
72
82
  body=RobotExecutionEventBody(
73
83
  type="test",
74
- id=f"{attributes.get('source', '')};{attributes.get('longname', '')};"
84
+ id=f"{source_from_attributes(attributes)};{attributes.get('longname', '')};"
75
85
  f"{attributes.get('lineno', 0)}",
76
86
  attributes=dict(attributes),
77
87
  ),
@@ -93,7 +103,7 @@ class ListenerV2:
93
103
  event="robotEnded",
94
104
  body=RobotExecutionEventBody(
95
105
  type="test",
96
- id=f"{attributes.get('source', '')};{attributes.get('longname', '')};"
106
+ id=f"{source_from_attributes(attributes)};{attributes.get('longname', '')};"
97
107
  f"{attributes.get('lineno', 0)}",
98
108
  attributes=dict(attributes),
99
109
  failed_keywords=self.failed_keywords,
@@ -142,9 +152,9 @@ class ListenerV2:
142
152
  item_id = next(
143
153
  (
144
154
  (
145
- f"{Path(item.source).resolve() if item.source is not None else ''};{item.longname}"
155
+ f"{normalized_path(Path(item.source)) if item.source is not None else ''};{item.longname}"
146
156
  if item.type == "SUITE"
147
- else f"{Path(item.source).resolve() if item.source is not None else ''};"
157
+ else f"{normalized_path(Path(item.source)) if item.source is not None else ''};"
148
158
  f"{item.longname};{item.line}"
149
159
  )
150
160
  for item in Debugger.instance().full_stack_frames
@@ -189,9 +199,9 @@ class ListenerV2:
189
199
  item_id = next(
190
200
  (
191
201
  (
192
- f"{Path(item.source).resolve() if item.source is not None else ''};{item.longname}"
202
+ f"{normalized_path(Path(item.source)) if item.source is not None else ''};{item.longname}"
193
203
  if item.type == "SUITE"
194
- else f"{Path(item.source).resolve() if item.source is not None else ''};"
204
+ else f"{normalized_path(Path(item.source)) if item.source is not None else ''};"
195
205
  f"{item.longname};{item.line}"
196
206
  )
197
207
  for item in Debugger.instance().full_stack_frames
@@ -266,7 +276,7 @@ class ListenerV3:
266
276
  item: Union[running.TestSuite, running.TestCase],
267
277
  ) -> Iterator[str]:
268
278
  if isinstance(item, running.TestSuite):
269
- yield f"{Path(item.source).resolve() if item.source is not None else ''};{item.longname}"
279
+ yield f"{normalized_path(item.source) if item.source is not None else ''};{item.longname}"
270
280
 
271
281
  for s in item.suites:
272
282
  yield from enqueue(s)
@@ -274,7 +284,7 @@ class ListenerV3:
274
284
  yield from enqueue(s)
275
285
  return
276
286
 
277
- yield f"{Path(item.source).resolve() if item.source is not None else ''};{item.longname};{item.lineno}"
287
+ yield (f"{normalized_path(item.source) if item.source is not None else ''};{item.longname};{item.lineno}")
278
288
 
279
289
  if self._event_sended:
280
290
  return
@@ -223,9 +223,9 @@ class DebugAdapterProtocol(JsonRPCProtocolBase):
223
223
  raise DebugAdapterRPCErrorException(
224
224
  f"Unknown Command '{message.command}'",
225
225
  error_message=Message(
226
- format='Unknown command "{command}"',
227
- variables={"command": str(message.command)},
228
- show_user=True,
226
+ format='Unknown command "{command}": {request}',
227
+ variables={"command": str(message.command), "request": str(message)},
228
+ show_user=False,
229
229
  ),
230
230
  )
231
231
 
@@ -1 +0,0 @@
1
- __version__ = "0.78.4"
@@ -208,10 +208,10 @@ async def run_debugger(
208
208
  wait_for_debugpy_connected()
209
209
 
210
210
  args = [
211
- "--listener",
212
- "robotcode.debugger.listeners.ListenerV2",
213
211
  "--listener",
214
212
  "robotcode.debugger.listeners.ListenerV3",
213
+ "--listener",
214
+ "robotcode.debugger.listeners.ListenerV2",
215
215
  *args,
216
216
  ]
217
217