robotcode-runner 0.82.0__tar.gz → 0.82.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotcode-runner
3
- Version: 0.82.0
3
+ Version: 0.82.2
4
4
  Summary: RobotCode runner plugin for Robot Framework
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -25,10 +25,10 @@ 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-modifiers==0.82.0
29
- Requires-Dist: robotcode-plugin==0.82.0
30
- Requires-Dist: robotcode-robot==0.82.0
31
- Requires-Dist: robotcode==0.82.0
28
+ Requires-Dist: robotcode-modifiers==0.82.2
29
+ Requires-Dist: robotcode-plugin==0.82.2
30
+ Requires-Dist: robotcode-robot==0.82.2
31
+ Requires-Dist: robotcode==0.82.2
32
32
  Requires-Dist: robotframework>=4.1.0
33
33
  Description-Content-Type: text/markdown
34
34
 
@@ -28,10 +28,10 @@ classifiers = [
28
28
  dynamic = ["version"]
29
29
  dependencies = [
30
30
  "robotframework>=4.1.0",
31
- "robotcode-robot==0.82.0",
32
- "robotcode-modifiers==0.82.0",
33
- "robotcode-plugin==0.82.0",
34
- "robotcode==0.82.0",
31
+ "robotcode-robot==0.82.2",
32
+ "robotcode-modifiers==0.82.2",
33
+ "robotcode-plugin==0.82.2",
34
+ "robotcode==0.82.2",
35
35
  ]
36
36
 
37
37
  [project.entry-points.robotcode]
@@ -0,0 +1 @@
1
+ __version__ = "0.82.2"
@@ -462,9 +462,7 @@ def handle_options(
462
462
  exclude_by_longname: Tuple[str, ...],
463
463
  robot_options_and_args: Tuple[str, ...],
464
464
  ) -> Tuple[TestSuite, Collector, Optional[Dict[str, List[Diagnostic]]]]:
465
- root_folder, profile, cmd_options = handle_robot_options(
466
- app, by_longname, exclude_by_longname, robot_options_and_args
467
- )
465
+ root_folder, profile, cmd_options = handle_robot_options(app, robot_options_and_args)
468
466
 
469
467
  diagnostics_logger = DiagnosticsLogger()
470
468
  try:
@@ -479,6 +477,8 @@ def handle_options(
479
477
  ),
480
478
  app.config.dry,
481
479
  root_folder,
480
+ by_longname,
481
+ exclude_by_longname,
482
482
  ).parse_arguments((*cmd_options, "--runemptysuite", *robot_options_and_args))
483
483
 
484
484
  settings = RobotSettings(options)
@@ -8,6 +8,7 @@ from robot.errors import DataError, Information
8
8
  from robot.run import USAGE, RobotFramework
9
9
  from robot.version import get_full_version
10
10
 
11
+ import robotcode.modifiers
11
12
  from robotcode.plugin import Application, pass_application
12
13
  from robotcode.plugin.click_helper.aliases import AliasedCommand
13
14
  from robotcode.plugin.click_helper.types import add_options
@@ -25,6 +26,8 @@ class RobotFrameworkEx(RobotFramework):
25
26
  paths: List[str],
26
27
  dry: bool,
27
28
  root_folder: Optional[Path],
29
+ by_longname: Tuple[str, ...] = (),
30
+ exclude_by_longname: Tuple[str, ...] = (),
28
31
  ) -> None:
29
32
  super().__init__()
30
33
  self.app = app
@@ -32,6 +35,8 @@ class RobotFrameworkEx(RobotFramework):
32
35
  self.dry = dry
33
36
  self.root_folder = root_folder
34
37
  self._orig_cwd = Path.cwd()
38
+ self.by_longname = by_longname
39
+ self.exclude_by_longname = exclude_by_longname
35
40
 
36
41
  def parse_arguments(self, cli_args: Any) -> Any:
37
42
  if self.root_folder is not None and Path.cwd() != self.root_folder:
@@ -61,6 +66,18 @@ class RobotFrameworkEx(RobotFramework):
61
66
  f'{line_end.join((*(f"{k} = {v!r}" for k, v in options.items()), *arguments))}'
62
67
  )
63
68
 
69
+ modifiers = []
70
+ root_name = options.get("name", None)
71
+
72
+ if self.by_longname:
73
+ modifiers.append(robotcode.modifiers.ByLongName(*self.by_longname, root_name=root_name))
74
+
75
+ if self.exclude_by_longname:
76
+ modifiers.append(robotcode.modifiers.ExcludedByLongName(*self.exclude_by_longname, root_name=root_name))
77
+
78
+ if modifiers:
79
+ options["prerunmodifier"] = options.get("prerunmodifier", []) + modifiers
80
+
64
81
  return options, arguments
65
82
 
66
83
 
@@ -90,10 +107,7 @@ ROBOT_OPTIONS: Set[click.Command] = {
90
107
 
91
108
 
92
109
  def handle_robot_options(
93
- app: Application,
94
- by_longname: Tuple[str, ...],
95
- exclude_by_longname: Tuple[str, ...],
96
- robot_options_and_args: Tuple[str, ...],
110
+ app: Application, robot_options_and_args: Tuple[str, ...]
97
111
  ) -> Tuple[Optional[Path], RobotBaseProfile, List[str]]:
98
112
  robot_arguments: Optional[List[Union[str, Path]]] = None
99
113
  old_sys_path = sys.path.copy()
@@ -118,20 +132,6 @@ def handle_robot_options(
118
132
 
119
133
  cmd_options = profile.build_command_line()
120
134
 
121
- if by_longname:
122
- sep = ";" if any(True for l in by_longname if ":" in l) else ":"
123
- cmd_options += (
124
- "--prerunmodifier",
125
- f"robotcode.modifiers.ByLongName{sep}{sep.join(by_longname)}",
126
- )
127
-
128
- if exclude_by_longname:
129
- sep = ";" if any(True for l in exclude_by_longname if ":" in l) else ":"
130
- cmd_options += (
131
- "--prerunmodifier",
132
- f"robotcode.modifiers.ExcludedByLongName{sep}{sep.join(exclude_by_longname)}",
133
- )
134
-
135
135
  app.verbose(
136
136
  lambda: "Executing robot with following options:\n "
137
137
  + " ".join(f'"{o}"' for o in (cmd_options + list(robot_options_and_args)))
@@ -170,9 +170,7 @@ def robot(
170
170
  ```
171
171
  """
172
172
 
173
- root_folder, profile, cmd_options = handle_robot_options(
174
- app, by_longname, exclude_by_longname, robot_options_and_args
175
- )
173
+ root_folder, profile, cmd_options = handle_robot_options(app, robot_options_and_args)
176
174
 
177
175
  app.exit(
178
176
  cast(
@@ -186,6 +184,8 @@ def robot(
186
184
  ),
187
185
  app.config.dry,
188
186
  root_folder,
187
+ by_longname,
188
+ exclude_by_longname,
189
189
  ).execute_cli((*cmd_options, *robot_options_and_args), exit=False),
190
190
  )
191
191
  )
@@ -1 +0,0 @@
1
- __version__ = "0.82.0"