robotcode-plugin 0.91.0__tar.gz → 0.93.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.
@@ -282,6 +282,8 @@ playground/
282
282
  test-results
283
283
  results.html
284
284
  report.html
285
+ log.html
286
+ output.xml
285
287
 
286
288
  # pyenv
287
289
  .python-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotcode-plugin
3
- Version: 0.91.0
3
+ Version: 0.93.0
4
4
  Summary: Some classes for RobotCode plugin management
5
5
  Project-URL: Donate, https://opencollective.com/robotcode
6
6
  Project-URL: Documentation, https://github.com/robotcodedev/robotcode#readme
@@ -64,6 +64,8 @@ class OutputFormat(str, Enum):
64
64
  class CommonConfig:
65
65
  config_files: Optional[Sequence[Path]] = None
66
66
  profiles: Optional[Sequence[str]] = None
67
+ root: Optional[Path] = None
68
+ no_vcs: bool = False
67
69
  dry: bool = False
68
70
  verbose: bool = False
69
71
  colored_output: ColoredOutput = ColoredOutput.AUTO
@@ -0,0 +1 @@
1
+ __version__ = "0.93.0"
@@ -40,10 +40,9 @@ class AliasedGroup(click.Group):
40
40
  limit = formatter.width - 6 - max(len(cmd[0]) for cmd in commands)
41
41
 
42
42
  rows = []
43
- for subcommand, cmd in commands:
43
+ for subcommand, cmd in sorted(commands):
44
44
  help = cmd.get_short_help_str(limit)
45
- rows.append((subcommand, help))
46
- rows.append(("", f"(Alias for `{cmd.name}` command)"))
45
+ rows.append((subcommand, f"{help} (Alias for `{cmd.name}` command)"))
47
46
  if rows:
48
47
  with formatter.section("Aliases"):
49
48
  formatter.write_dl(rows)
@@ -0,0 +1,40 @@
1
+ from typing import List, Optional, cast
2
+
3
+ import click
4
+ import pluggy
5
+ from typing_extensions import Self
6
+
7
+ from . import specs
8
+
9
+
10
+ class PluginManager:
11
+ _instance: Optional["Self"] = None
12
+
13
+ @classmethod
14
+ def instance(cls) -> "Self":
15
+ if cls._instance is None:
16
+ cls._instance = cls()
17
+ return cast("Self", cls._instance)
18
+
19
+ def __init__(self) -> None:
20
+ self._plugin_manager = pluggy.PluginManager("robotcode")
21
+ self._plugin_manager.add_hookspecs(specs)
22
+ self._plugin_manager.load_setuptools_entrypoints("robotcode")
23
+
24
+ @property
25
+ def cli_commands(self) -> List[click.Command]:
26
+ result: List[click.Command] = []
27
+ for l in self._plugin_manager.hook.register_cli_commands():
28
+ result.extend(cast(List[click.Command], l))
29
+ return result
30
+
31
+ @property
32
+ def tool_config_classes(
33
+ self,
34
+ ) -> List[specs.ToolConfig]:
35
+ result: List[specs.ToolConfig] = []
36
+
37
+ for l in self._plugin_manager.hook.register_tool_config_classes():
38
+ result.extend(cast(List[specs.ToolConfig], l))
39
+
40
+ return result
@@ -0,0 +1,22 @@
1
+ from typing import Any, Callable, List, NamedTuple, Type, TypeVar, cast
2
+
3
+ import click
4
+ import pluggy
5
+
6
+ F = TypeVar("F", bound=Callable[..., Any])
7
+ hookspec = cast(Callable[[F], F], pluggy.HookspecMarker("robotcode"))
8
+
9
+
10
+ @hookspec
11
+ def register_cli_commands() -> List[click.Command]: # type: ignore
12
+ """Register new command for the commandline."""
13
+
14
+
15
+ class ToolConfig(NamedTuple):
16
+ tool_name: str
17
+ config_class: Type[Any]
18
+
19
+
20
+ @hookspec
21
+ def register_tool_config_classes() -> List[ToolConfig]: # type: ignore
22
+ """Registers a class that gives information about a tool configuration."""
@@ -1 +0,0 @@
1
- __version__ = "0.91.0"
@@ -1,29 +0,0 @@
1
- from typing import List, Tuple, Type, cast
2
-
3
- import click
4
- import pluggy
5
-
6
- from . import specs
7
-
8
-
9
- class PluginManager:
10
- def __init__(self) -> None:
11
- self._plugin_manager = pluggy.PluginManager("robotcode")
12
- self._plugin_manager.add_hookspecs(specs)
13
- self._plugin_manager.load_setuptools_entrypoints("robotcode")
14
-
15
- @property
16
- def cli_commands(self) -> List[List[click.Command]]:
17
- return cast(
18
- List[List[click.Command]],
19
- self._plugin_manager.hook.register_cli_commands(),
20
- )
21
-
22
- @property
23
- def config_classes(
24
- self,
25
- ) -> List[List[Tuple[str, Type[specs.TConfigClass]]]]:
26
- return cast(
27
- List[List[Tuple[str, Type[specs.TConfigClass]]]],
28
- self._plugin_manager.hook.register_config_classes(),
29
- )
@@ -1,20 +0,0 @@
1
- from typing import Any, Callable, List, Tuple, Type, TypeVar, cast
2
-
3
- import click
4
- import pluggy
5
-
6
- F = TypeVar("F", bound=Callable[..., Any])
7
- hookspec = cast(Callable[[F], F], pluggy.HookspecMarker("robotcode"))
8
-
9
-
10
- @hookspec
11
- def register_cli_commands() -> List[click.Command]: # type: ignore
12
- """Register new command for the commandline."""
13
-
14
-
15
- TConfigClass = TypeVar("TConfigClass")
16
-
17
-
18
- @hookspec
19
- def register_config_classes() -> List[Tuple[str, Type[TConfigClass]]]: # type: ignore
20
- """Registers a class that gives information about a configuration."""