robotcode-core 0.80.0__tar.gz → 0.82.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 (34) hide show
  1. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/PKG-INFO +2 -2
  2. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/pyproject.toml +1 -1
  3. robotcode_core-0.82.0/src/robotcode/core/__version__.py +1 -0
  4. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/concurrent.py +21 -1
  5. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/debugpy.py +16 -2
  6. robotcode_core-0.80.0/src/robotcode/core/__version__.py +0 -1
  7. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/.gitignore +0 -0
  8. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/LICENSE.txt +0 -0
  9. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/README.md +0 -0
  10. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/__init__.py +0 -0
  11. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/async_tools.py +0 -0
  12. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/documents_manager.py +0 -0
  13. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/event.py +0 -0
  14. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/filewatcher.py +0 -0
  15. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/language.py +0 -0
  16. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/lsp/__init__.py +0 -0
  17. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/lsp/types.py +0 -0
  18. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/py.typed +0 -0
  19. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/text_document.py +0 -0
  20. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/types.py +0 -0
  21. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/uri.py +0 -0
  22. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/__init__.py +0 -0
  23. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/caching.py +0 -0
  24. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/cli.py +0 -0
  25. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/dataclasses.py +0 -0
  26. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/glob_path.py +0 -0
  27. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/inspect.py +0 -0
  28. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/logging.py +0 -0
  29. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/net.py +0 -0
  30. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/path.py +0 -0
  31. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/process.py +0 -0
  32. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/safe_eval.py +0 -0
  33. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/utils/version.py +0 -0
  34. {robotcode_core-0.80.0 → robotcode_core-0.82.0}/src/robotcode/core/workspace.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotcode-core
3
- Version: 0.80.0
3
+ Version: 0.82.0
4
4
  Summary: Some core classes for RobotCode
5
5
  Project-URL: Homepage, https://robotcode.io
6
- Project-URL: Donate, https://github.com/sponsors/d-biehl
6
+ Project-URL: Donate, https://opencollective.com/robotcode
7
7
  Project-URL: Documentation, https://github.com/robotcodedev/robotcode#readme
8
8
  Project-URL: Changelog, https://github.com/robotcodedev/robotcode/blob/main/CHANGELOG.md
9
9
  Project-URL: Issues, https://github.com/robotcodedev/robotcode/issues
@@ -30,7 +30,7 @@ dynamic = ["version"]
30
30
 
31
31
  [project.urls]
32
32
  Homepage = "https://robotcode.io"
33
- Donate = "https://github.com/sponsors/d-biehl"
33
+ Donate = "https://opencollective.com/robotcode"
34
34
  Documentation = "https://github.com/robotcodedev/robotcode#readme"
35
35
  Changelog = "https://github.com/robotcodedev/robotcode/blob/main/CHANGELOG.md"
36
36
  Issues = "https://github.com/robotcodedev/robotcode/issues"
@@ -0,0 +1 @@
1
+ __version__ = "0.82.0"
@@ -217,7 +217,9 @@ def _remove_future_from_running_tasks(future: Task[Any]) -> None:
217
217
  _P = ParamSpec("_P")
218
218
 
219
219
 
220
- def run_as_task(callable: Callable[_P, _TResult], *args: _P.args, **kwargs: _P.kwargs) -> Task[_TResult]:
220
+ def _create_task_in_thread(
221
+ callable: Callable[_P, _TResult], *args: _P.args, **kwargs: _P.kwargs
222
+ ) -> Tuple[Task[_TResult], threading.Thread]:
221
223
  future: Task[_TResult] = Task()
222
224
  with _running_tasks_lock:
223
225
  thread = threading.Thread(
@@ -227,8 +229,26 @@ def run_as_task(callable: Callable[_P, _TResult], *args: _P.args, **kwargs: _P.k
227
229
  )
228
230
  _running_tasks[future] = thread
229
231
  future.add_done_callback(_remove_future_from_running_tasks)
232
+
230
233
  # TODO: don't set daemon=True because it can be deprecated in future pyhton versions
231
234
  thread.daemon = True
235
+ return future, thread
236
+
237
+
238
+ def run_as_task(callable: Callable[_P, _TResult], *args: _P.args, **kwargs: _P.kwargs) -> Task[_TResult]:
239
+ future, thread = _create_task_in_thread(callable, *args, **kwargs)
240
+
241
+ thread.start()
242
+
243
+ return future
244
+
245
+
246
+ def run_as_debugpy_hidden_task(callable: Callable[_P, _TResult], *args: _P.args, **kwargs: _P.kwargs) -> Task[_TResult]:
247
+ future, thread = _create_task_in_thread(callable, *args, **kwargs)
248
+
249
+ thread.pydev_do_not_trace = True # type: ignore[attr-defined]
250
+ thread.is_pydev_daemon_thread = True # type: ignore[attr-defined]
251
+
232
252
  thread.start()
233
253
 
234
254
  return future
@@ -1,5 +1,8 @@
1
+ import threading
1
2
  from typing import Optional, Sequence, Tuple, Union
2
3
 
4
+ from robotcode.core.concurrent import run_as_debugpy_hidden_task
5
+
3
6
  from .logging import LoggingDescriptor
4
7
  from .net import find_free_port
5
8
 
@@ -15,14 +18,25 @@ def is_debugpy_installed() -> bool:
15
18
  return True
16
19
 
17
20
 
18
- def wait_for_debugpy_connected() -> bool:
21
+ def wait_for_debugpy_connected(timeout: float = 30) -> bool:
19
22
  if is_debugpy_installed():
20
23
  import debugpy # noqa: T100
21
24
 
25
+ connected = threading.Event()
22
26
  _logger.info("wait for debugpy client")
27
+
28
+ def _wait_for_client() -> bool:
29
+ if not connected.wait(timeout=timeout):
30
+ debugpy.wait_for_client.cancel()
31
+ return False
32
+
33
+ return True
34
+
35
+ wait_task = run_as_debugpy_hidden_task(_wait_for_client)
23
36
  debugpy.wait_for_client() # noqa: T100
37
+ connected.set()
38
+ return wait_task.result()
24
39
 
25
- return True
26
40
  return False
27
41
 
28
42
 
@@ -1 +0,0 @@
1
- __version__ = "0.80.0"