robotcode-core 0.99.0__tar.gz → 0.100.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 (36) hide show
  1. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/PKG-INFO +1 -1
  2. robotcode_core-0.100.1/src/robotcode/core/__version__.py +1 -0
  3. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/concurrent.py +4 -6
  4. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/event.py +1 -1
  5. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/ignore_spec.py +0 -1
  6. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/uri.py +0 -1
  7. robotcode_core-0.100.1/src/robotcode/core/utils/contextlib.py +44 -0
  8. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/dataclasses.py +6 -5
  9. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/glob_path.py +2 -2
  10. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/logging.py +1 -1
  11. robotcode_core-0.99.0/src/robotcode/core/__version__.py +0 -1
  12. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/.gitignore +0 -0
  13. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/LICENSE.txt +0 -0
  14. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/README.md +0 -0
  15. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/pyproject.toml +0 -0
  16. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/__init__.py +0 -0
  17. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/async_tools.py +0 -0
  18. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/documents_manager.py +0 -0
  19. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/filewatcher.py +0 -0
  20. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/language.py +0 -0
  21. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/lsp/__init__.py +0 -0
  22. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/lsp/types.py +0 -0
  23. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/py.typed +0 -0
  24. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/text_document.py +0 -0
  25. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/types.py +0 -0
  26. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/__init__.py +0 -0
  27. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/caching.py +0 -0
  28. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/cli.py +0 -0
  29. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/debugpy.py +0 -0
  30. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/inspect.py +0 -0
  31. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/net.py +0 -0
  32. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/path.py +0 -0
  33. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/process.py +0 -0
  34. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/safe_eval.py +0 -0
  35. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/utils/version.py +0 -0
  36. {robotcode_core-0.99.0 → robotcode_core-0.100.1}/src/robotcode/core/workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotcode-core
3
- Version: 0.99.0
3
+ Version: 0.100.1
4
4
  Summary: Some core classes for RobotCode
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -0,0 +1 @@
1
+ __version__ = "0.100.1"
@@ -145,10 +145,8 @@ def threaded_task(__func: _F = None, *, enabled: bool = True) -> Callable[[_F],
145
145
 
146
146
 
147
147
  def is_threaded_callable(callable: Callable[..., Any]) -> bool:
148
- return (
149
- getattr(callable, __THREADED_MARKER, False)
150
- or inspect.ismethod(callable)
151
- and getattr(callable, __THREADED_MARKER, False)
148
+ return getattr(callable, __THREADED_MARKER, False) or (
149
+ inspect.ismethod(callable) and getattr(callable, __THREADED_MARKER, False)
152
150
  )
153
151
 
154
152
 
@@ -251,8 +249,8 @@ def run_as_debugpy_hidden_task(callable: Callable[_P, _TResult], *args: _P.args,
251
249
  hide = hidden_tasks == "0"
252
250
 
253
251
  if hide:
254
- thread.pydev_do_not_trace = True # type: ignore[attr-defined]
255
- thread.is_pydev_daemon_thread = True # type: ignore[attr-defined]
252
+ setattr(thread, "pydev_do_not_trace", True)
253
+ setattr(thread, "is_pydev_daemon_thread", True)
256
254
 
257
255
  thread.start()
258
256
 
@@ -19,7 +19,7 @@ from typing import (
19
19
 
20
20
  from typing_extensions import ParamSpec
21
21
 
22
- __all__ = ["event_iterator", "event"]
22
+ __all__ = ["event", "event_iterator"]
23
23
 
24
24
  _TResult = TypeVar("_TResult")
25
25
  _TParams = ParamSpec("_TParams")
@@ -142,7 +142,6 @@ class IgnoreSpec(_HelperCache):
142
142
  def _rule_from_pattern(
143
143
  cls, pattern: str, base_path: PurePath, source: Optional[Tuple[str, int]] = None
144
144
  ) -> Optional[IgnoreRule]:
145
-
146
145
  orig_pattern = pattern
147
146
 
148
147
  if pattern.strip() == "" or pattern[0] == "#":
@@ -209,7 +209,6 @@ class Uri(Mapping[str, str]):
209
209
  query: Optional[str] = None,
210
210
  fragment: Optional[str] = None,
211
211
  ) -> Uri:
212
-
213
212
  return Uri(
214
213
  scheme=scheme if scheme is not None else self.scheme,
215
214
  netloc=netloc if netloc is not None else self.netloc,
@@ -0,0 +1,44 @@
1
+ import os
2
+ from contextlib import AbstractContextManager
3
+ from pathlib import Path
4
+ from typing import Any, Callable, List, Literal, Optional, Union
5
+
6
+ from .path import same_file
7
+
8
+
9
+ class ChDir(AbstractContextManager[Any]):
10
+ def __init__(
11
+ self, path: "Union[str, os.PathLike[str], None]", verbose_callback: Optional[Callable[[str], None]] = None
12
+ ) -> None:
13
+ self.path = path
14
+ self._old_cwd: List[Optional[Path]] = []
15
+ self._verbose_callback = verbose_callback
16
+
17
+ def __enter__(self) -> Optional[Path]:
18
+ result = Path.cwd()
19
+
20
+ if self.path is None or (self._old_cwd and same_file(self.path, Path.cwd())):
21
+ self._old_cwd.append(None)
22
+ else:
23
+ self._old_cwd.append(result)
24
+
25
+ if self.path:
26
+ if self._verbose_callback:
27
+ self._verbose_callback(f"Changing directory to {self.path}")
28
+
29
+ os.chdir(self.path)
30
+
31
+ return result
32
+
33
+ def __exit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> Literal[False]:
34
+ old_path = self._old_cwd.pop()
35
+ if old_path is not None:
36
+ if self._verbose_callback:
37
+ self._verbose_callback(f"Changing directory back to {old_path}")
38
+
39
+ os.chdir(old_path)
40
+
41
+ return False
42
+
43
+
44
+ chdir = ChDir
@@ -28,14 +28,14 @@ from typing import (
28
28
  )
29
29
 
30
30
  __all__ = [
31
- "to_snake_case",
32
- "to_camel_case",
31
+ "CamelSnakeMixin",
32
+ "ValidateMixin",
33
+ "as_dict",
33
34
  "as_json",
34
35
  "from_dict",
35
36
  "from_json",
36
- "as_dict",
37
- "ValidateMixin",
38
- "CamelSnakeMixin",
37
+ "to_camel_case",
38
+ "to_snake_case",
39
39
  ]
40
40
 
41
41
  _RE_SNAKE_CASE_1 = re.compile(r"[\-\.\s]")
@@ -190,6 +190,7 @@ def as_json(obj: Any, indent: Optional[bool] = None, compact: Optional[bool] = N
190
190
  default=_default,
191
191
  indent=4 if indent else None,
192
192
  separators=(",", ":") if compact else None,
193
+ ensure_ascii=False,
193
194
  )
194
195
 
195
196
 
@@ -164,7 +164,7 @@ def _iter_files_recursive_re(
164
164
  relative_path = (path / f.name).relative_to(_base_path)
165
165
 
166
166
  if not ignore_patterns or not any(
167
- p.matches(relative_path) and (not p.only_dirs or p.only_dirs and f.is_dir())
167
+ p.matches(relative_path) and (not p.only_dirs or (p.only_dirs and f.is_dir()))
168
168
  for p in cast(Iterable[Pattern], ignore_patterns)
169
169
  ):
170
170
  if f.is_dir():
@@ -177,7 +177,7 @@ def _iter_files_recursive_re(
177
177
  _base_path=_base_path,
178
178
  )
179
179
  if not patterns or any(
180
- p.matches(relative_path) and (not p.only_dirs or p.only_dirs and f.is_dir())
180
+ p.matches(relative_path) and (not p.only_dirs or (p.only_dirs and f.is_dir()))
181
181
  for p in cast(Iterable[Pattern], patterns)
182
182
  ):
183
183
  yield Path(f).absolute() if absolute else Path(f)
@@ -196,7 +196,7 @@ class LoggingDescriptor:
196
196
  extra: Optional[Mapping[str, object]] = None,
197
197
  **kwargs: Any,
198
198
  ) -> None:
199
- if self.is_enabled_for(level) and condition is not None and condition() or condition is None:
199
+ if (self.is_enabled_for(level) and condition is not None and condition()) or condition is None:
200
200
  depth = 0
201
201
  if context_name is not None:
202
202
  depth = self._measure_contexts.get(context_name, 0)
@@ -1 +0,0 @@
1
- __version__ = "0.99.0"