robotcode-runner 0.41.0__tar.gz → 0.43.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.
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/PKG-INFO +4 -4
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/pyproject.toml +3 -3
- robotcode_runner-0.43.1/src/robotcode/runner/__version__.py +1 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/discover/discover.py +158 -43
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/libdoc.py +1 -1
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/rebot.py +2 -2
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/robot.py +2 -0
- robotcode_runner-0.41.0/src/robotcode/runner/__version__.py +0 -1
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/.gitignore +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/LICENSE.txt +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/README.md +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/__init__.py +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/__init__.py +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/discover/__init__.py +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/testdoc.py +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/hooks.py +0 -0
- {robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: robotcode-runner
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.43.1
|
|
4
4
|
Summary: RobotCode runner plugin for Robot Framework
|
|
5
5
|
Project-URL: Homepage, https://robotcode.io
|
|
6
6
|
Project-URL: Donate, https://github.com/sponsors/d-biehl
|
|
@@ -25,9 +25,9 @@ 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.
|
|
29
|
-
Requires-Dist: robotcode-robot==0.
|
|
30
|
-
Requires-Dist: robotcode==0.
|
|
28
|
+
Requires-Dist: robotcode-modifiers==0.43.1
|
|
29
|
+
Requires-Dist: robotcode-robot==0.43.1
|
|
30
|
+
Requires-Dist: robotcode==0.43.1
|
|
31
31
|
Requires-Dist: robotframework>=4.1.0
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
33
33
|
|
|
@@ -28,9 +28,9 @@ classifiers = [
|
|
|
28
28
|
dynamic = ["version"]
|
|
29
29
|
dependencies = [
|
|
30
30
|
"robotframework>=4.1.0",
|
|
31
|
-
"robotcode-robot==0.
|
|
32
|
-
"robotcode-modifiers==0.
|
|
33
|
-
"robotcode==0.
|
|
31
|
+
"robotcode-robot==0.43.1",
|
|
32
|
+
"robotcode-modifiers==0.43.1",
|
|
33
|
+
"robotcode==0.43.1",
|
|
34
34
|
]
|
|
35
35
|
|
|
36
36
|
[project.entry-points.robotcode]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.43.1"
|
{robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/discover/discover.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import platform
|
|
2
3
|
import re
|
|
3
4
|
import sys
|
|
4
5
|
from collections import defaultdict
|
|
@@ -44,8 +45,8 @@ def _patch() -> None:
|
|
|
44
45
|
return
|
|
45
46
|
__patched = True
|
|
46
47
|
|
|
47
|
-
if get_robot_version() <= (6, 1
|
|
48
|
-
if get_robot_version() > (5, 0) and get_robot_version() < (6, 0
|
|
48
|
+
if get_robot_version() <= (6, 1):
|
|
49
|
+
if get_robot_version() > (5, 0) and get_robot_version() < (6, 0) or get_robot_version() < (5, 0):
|
|
49
50
|
from robot.running.builder.testsettings import TestDefaults # pyright: ignore[reportMissingImports]
|
|
50
51
|
else:
|
|
51
52
|
from robot.running.builder.settings import Defaults as TestDefaults # pyright: ignore[reportMissingImports]
|
|
@@ -69,7 +70,7 @@ def _patch() -> None:
|
|
|
69
70
|
except DataError as e:
|
|
70
71
|
LOGGER.error(str(e))
|
|
71
72
|
parent_defaults = self._stack[-1][-1] if self._stack else None
|
|
72
|
-
if get_robot_version() < (6, 1
|
|
73
|
+
if get_robot_version() < (6, 1):
|
|
73
74
|
from robot.running.builder.parsers import format_name
|
|
74
75
|
|
|
75
76
|
return ErroneousTestSuite(
|
|
@@ -82,7 +83,17 @@ def _patch() -> None:
|
|
|
82
83
|
|
|
83
84
|
SuiteStructureParser._build_suite = build_suite
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
old_validate_execution_mode = SuiteStructureParser._validate_execution_mode
|
|
87
|
+
|
|
88
|
+
def _validate_execution_mode(self: SuiteStructureParser, suite: TestSuite) -> None:
|
|
89
|
+
try:
|
|
90
|
+
old_validate_execution_mode(self, suite)
|
|
91
|
+
except DataError as e:
|
|
92
|
+
LOGGER.error(f"Parsing '{suite.source}' failed: {e.message}")
|
|
93
|
+
|
|
94
|
+
SuiteStructureParser._validate_execution_mode = _validate_execution_mode
|
|
95
|
+
|
|
96
|
+
elif get_robot_version() >= (6, 1):
|
|
86
97
|
from robot.parsing.suitestructure import SuiteDirectory, SuiteFile
|
|
87
98
|
from robot.running.builder.settings import TestDefaults # pyright: ignore[reportMissingImports]
|
|
88
99
|
|
|
@@ -124,6 +135,16 @@ def _patch() -> None:
|
|
|
124
135
|
|
|
125
136
|
SuiteStructureParser._build_suite_directory = build_suite_directory
|
|
126
137
|
|
|
138
|
+
old_validate_execution_mode = SuiteStructureParser._validate_execution_mode
|
|
139
|
+
|
|
140
|
+
def _validate_execution_mode(self: SuiteStructureParser, suite: TestSuite) -> None:
|
|
141
|
+
try:
|
|
142
|
+
old_validate_execution_mode(self, suite)
|
|
143
|
+
except DataError as e:
|
|
144
|
+
LOGGER.error(f"Parsing '{suite.source}' failed: {e.message}")
|
|
145
|
+
|
|
146
|
+
SuiteStructureParser._validate_execution_mode = _validate_execution_mode
|
|
147
|
+
|
|
127
148
|
old_get_file = FileReader._get_file
|
|
128
149
|
|
|
129
150
|
def get_file(self: FileReader, source: Union[str, Path, IOBase], accept_text: bool) -> Any:
|
|
@@ -145,6 +166,8 @@ class TestItem:
|
|
|
145
166
|
name: str
|
|
146
167
|
longname: str
|
|
147
168
|
uri: Optional[DocumentUri] = None
|
|
169
|
+
rel_source: Optional[str] = None
|
|
170
|
+
needs_parse_include: bool = False
|
|
148
171
|
children: Optional[List["TestItem"]] = None
|
|
149
172
|
description: Optional[str] = None
|
|
150
173
|
range: Optional[Range] = None
|
|
@@ -165,6 +188,15 @@ class Statistics:
|
|
|
165
188
|
tests: int = 0
|
|
166
189
|
|
|
167
190
|
|
|
191
|
+
def get_rel_source(source: Optional[str]) -> Optional[str]:
|
|
192
|
+
if source is None:
|
|
193
|
+
return None
|
|
194
|
+
try:
|
|
195
|
+
return str(Path(source).relative_to(Path.cwd()).as_posix())
|
|
196
|
+
except ValueError:
|
|
197
|
+
return str(source)
|
|
198
|
+
|
|
199
|
+
|
|
168
200
|
class Collector(SuiteVisitor):
|
|
169
201
|
def __init__(self) -> None:
|
|
170
202
|
super().__init__()
|
|
@@ -174,6 +206,7 @@ class Collector(SuiteVisitor):
|
|
|
174
206
|
name=Path.cwd().name,
|
|
175
207
|
longname=Path.cwd().name,
|
|
176
208
|
uri=str(Uri.from_path(Path.cwd())),
|
|
209
|
+
needs_parse_include=get_robot_version() >= (6, 1),
|
|
177
210
|
)
|
|
178
211
|
self._current = self.all
|
|
179
212
|
self.suites: List[TestItem] = []
|
|
@@ -182,21 +215,25 @@ class Collector(SuiteVisitor):
|
|
|
182
215
|
self.statistics = Statistics()
|
|
183
216
|
|
|
184
217
|
def visit_suite(self, suite: TestSuite) -> None:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
218
|
+
try:
|
|
219
|
+
item = TestItem(
|
|
220
|
+
type="suite",
|
|
221
|
+
id=f"{Path(suite.source).resolve() if suite.source is not None else ''};{suite.longname}",
|
|
222
|
+
name=suite.name,
|
|
223
|
+
longname=suite.longname,
|
|
224
|
+
uri=str(Uri.from_path(Path(suite.source).resolve())) if suite.source else None,
|
|
225
|
+
rel_source=get_rel_source(suite.source),
|
|
226
|
+
range=Range(
|
|
227
|
+
start=Position(line=0, character=0),
|
|
228
|
+
end=Position(line=0, character=0),
|
|
229
|
+
)
|
|
230
|
+
if suite.source and Path(suite.source).is_file()
|
|
231
|
+
else None,
|
|
232
|
+
children=[],
|
|
233
|
+
error=suite.error_message if isinstance(suite, ErroneousTestSuite) else None,
|
|
194
234
|
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
children=[],
|
|
198
|
-
error=suite.error_message if isinstance(suite, ErroneousTestSuite) else None,
|
|
199
|
-
)
|
|
235
|
+
except ValueError as e:
|
|
236
|
+
raise ValueError(f"Error while parsing suite {suite.source}: {e}") from e
|
|
200
237
|
|
|
201
238
|
self.suites.append(item)
|
|
202
239
|
|
|
@@ -218,18 +255,23 @@ class Collector(SuiteVisitor):
|
|
|
218
255
|
def visit_test(self, test: TestCase) -> None:
|
|
219
256
|
if self._current.children is None:
|
|
220
257
|
self._current.children = []
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
258
|
+
try:
|
|
259
|
+
item = TestItem(
|
|
260
|
+
type="test",
|
|
261
|
+
id=f"{Path(test.source).resolve() if test.source is not None else ''};{test.longname};{test.lineno}",
|
|
262
|
+
name=test.name,
|
|
263
|
+
longname=test.longname,
|
|
264
|
+
uri=str(Uri.from_path(Path(test.source).resolve())) if test.source else None,
|
|
265
|
+
rel_source=get_rel_source(test.source),
|
|
266
|
+
range=Range(
|
|
267
|
+
start=Position(line=test.lineno - 1, character=0),
|
|
268
|
+
end=Position(line=test.lineno - 1, character=0),
|
|
269
|
+
),
|
|
270
|
+
tags=list(test.tags) if test.tags else None,
|
|
271
|
+
)
|
|
272
|
+
except ValueError as e:
|
|
273
|
+
raise ValueError(f"Error while parsing suite {test.source}: {e}") from e
|
|
274
|
+
|
|
233
275
|
for tag in test.tags:
|
|
234
276
|
self.tags[str(tag)].append(item)
|
|
235
277
|
|
|
@@ -280,7 +322,7 @@ def build_diagnostics(messages: List[Message]) -> Dict[str, List[Diagnostic]]:
|
|
|
280
322
|
def add_diagnostic(
|
|
281
323
|
message: Message, source_uri: Optional[str] = None, line: Optional[int] = None, text: Optional[str] = None
|
|
282
324
|
) -> None:
|
|
283
|
-
source_uri = str(Uri.from_path(Path(source_uri).
|
|
325
|
+
source_uri = str(Uri.from_path(Path(source_uri).resolve() if source_uri else Path.cwd()))
|
|
284
326
|
|
|
285
327
|
if source_uri not in result:
|
|
286
328
|
result[source_uri] = []
|
|
@@ -344,16 +386,16 @@ def handle_options(
|
|
|
344
386
|
if settings.pythonpath:
|
|
345
387
|
sys.path = settings.pythonpath + sys.path
|
|
346
388
|
|
|
347
|
-
if get_robot_version() > (6, 1
|
|
389
|
+
if get_robot_version() > (6, 1):
|
|
348
390
|
builder = TestSuiteBuilder(
|
|
349
|
-
settings["SuiteNames"],
|
|
350
|
-
custom_parsers=settings.parsers,
|
|
351
391
|
included_extensions=settings.extension,
|
|
392
|
+
included_files=settings.parse_include,
|
|
393
|
+
custom_parsers=settings.parsers,
|
|
352
394
|
rpa=settings.rpa,
|
|
353
395
|
lang=settings.languages,
|
|
354
396
|
allow_empty_suite=settings.run_empty_suite,
|
|
355
397
|
)
|
|
356
|
-
elif get_robot_version() >= (6, 0
|
|
398
|
+
elif get_robot_version() >= (6, 0):
|
|
357
399
|
builder = TestSuiteBuilder(
|
|
358
400
|
settings["SuiteNames"],
|
|
359
401
|
included_extensions=settings.extension,
|
|
@@ -576,7 +618,7 @@ def tags(
|
|
|
576
618
|
```
|
|
577
619
|
"""
|
|
578
620
|
|
|
579
|
-
suite,
|
|
621
|
+
suite, _diagnostics = handle_options(app, by_longname, exclude_by_longname, robot_options_and_args)
|
|
580
622
|
|
|
581
623
|
collector = Collector()
|
|
582
624
|
suite.visit(collector)
|
|
@@ -587,16 +629,89 @@ def tags(
|
|
|
587
629
|
def print(tags: Dict[str, List[TestItem]]) -> Iterable[str]:
|
|
588
630
|
for tag, items in tags.items():
|
|
589
631
|
yield f"{tag}{os.linesep}"
|
|
590
|
-
# for item in items:
|
|
591
|
-
# yield f" {item.longname}{os.linesep}"
|
|
592
|
-
# if item.uri:
|
|
593
|
-
# yield (
|
|
594
|
-
# f" ({Uri(item.uri).to_path()}{f':{item.range.start.line+1}' if item.range else ''})"
|
|
595
|
-
# f"{os.linesep}"
|
|
596
|
-
# )
|
|
597
632
|
|
|
598
633
|
if collector.suites:
|
|
599
634
|
app.echo_via_pager(print(collector.tags))
|
|
600
635
|
|
|
601
636
|
else:
|
|
602
637
|
app.print_data(TagsResult(collector.tags), remove_defaults=True)
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
@dataclass
|
|
641
|
+
class RobotVersion:
|
|
642
|
+
major: int
|
|
643
|
+
minor: int
|
|
644
|
+
patch: Optional[int] = None
|
|
645
|
+
pre_id: Optional[str] = None
|
|
646
|
+
pre_number: Optional[int] = None
|
|
647
|
+
dev: Optional[int] = None
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
@dataclass
|
|
651
|
+
class PythonVersion:
|
|
652
|
+
major: int
|
|
653
|
+
minor: int
|
|
654
|
+
micro: int
|
|
655
|
+
releaselevel: str
|
|
656
|
+
serial: int
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
@dataclass
|
|
660
|
+
class Info:
|
|
661
|
+
robot_version: RobotVersion
|
|
662
|
+
robot_version_string: str
|
|
663
|
+
robot_env: Dict[str, str]
|
|
664
|
+
python_version: PythonVersion
|
|
665
|
+
python_version_string: str
|
|
666
|
+
machine: str
|
|
667
|
+
processor: str
|
|
668
|
+
platform: str
|
|
669
|
+
system: str
|
|
670
|
+
system_version: str
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
@discover.command(
|
|
674
|
+
add_help_option=True,
|
|
675
|
+
)
|
|
676
|
+
@pass_application
|
|
677
|
+
def info(
|
|
678
|
+
app: Application,
|
|
679
|
+
) -> None:
|
|
680
|
+
"""\
|
|
681
|
+
Shows some informations about the current *robot* environment.
|
|
682
|
+
|
|
683
|
+
\b
|
|
684
|
+
Examples:
|
|
685
|
+
```
|
|
686
|
+
robotcode discover info
|
|
687
|
+
```
|
|
688
|
+
"""
|
|
689
|
+
from robot.version import get_version as get_version
|
|
690
|
+
|
|
691
|
+
robot_env: Dict[str, str] = {}
|
|
692
|
+
if "ROBOT_OPTIONS" in os.environ:
|
|
693
|
+
robot_env["ROBOT_OPTIONS"] = os.environ["ROBOT_OPTIONS"]
|
|
694
|
+
if "ROBOT_SYSLOG_FILE" in os.environ:
|
|
695
|
+
robot_env["ROBOT_SYSLOG_FILE"] = os.environ["ROBOT_SYSLOG_FILE"]
|
|
696
|
+
if "ROBOT_SYSLOG_LEVEL" in os.environ:
|
|
697
|
+
robot_env["ROBOT_SYSLOG_LEVEL"] = os.environ["ROBOT_SYSLOG_LEVEL"]
|
|
698
|
+
if "ROBOT_INTERNAL_TRACES" in os.environ:
|
|
699
|
+
robot_env["ROBOT_INTERNAL_TRACES"] = os.environ["ROBOT_INTERNAL_TRACES"]
|
|
700
|
+
|
|
701
|
+
info = Info(
|
|
702
|
+
RobotVersion(*get_robot_version()),
|
|
703
|
+
get_version(),
|
|
704
|
+
robot_env,
|
|
705
|
+
PythonVersion(*sys.version_info),
|
|
706
|
+
platform.python_version(),
|
|
707
|
+
platform.machine(),
|
|
708
|
+
platform.processor(),
|
|
709
|
+
sys.platform,
|
|
710
|
+
platform.system(),
|
|
711
|
+
platform.version(),
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
if app.config.output_format is None or app.config.output_format == OutputFormat.TEXT:
|
|
715
|
+
app.print_data(info, remove_defaults=True)
|
|
716
|
+
else:
|
|
717
|
+
app.print_data(info, remove_defaults=True)
|
|
@@ -51,7 +51,7 @@ class LibDocEx(LibDoc):
|
|
|
51
51
|
@click.version_option(
|
|
52
52
|
version=__version__,
|
|
53
53
|
package_name="robotcode.runner.libdoc",
|
|
54
|
-
prog_name="RobotCode
|
|
54
|
+
prog_name="RobotCode libdoc",
|
|
55
55
|
message=f"%(prog)s %(version)s\n{USAGE.splitlines()[0].split(' -- ')[0].strip()} {get_full_version()}",
|
|
56
56
|
)
|
|
57
57
|
@click.argument("robot_options_and_args", nargs=-1, type=click.Path())
|
|
@@ -50,8 +50,8 @@ class RebotEx(Rebot):
|
|
|
50
50
|
)
|
|
51
51
|
@click.version_option(
|
|
52
52
|
version=__version__,
|
|
53
|
-
package_name="robotcode.runner.
|
|
54
|
-
prog_name="RobotCode
|
|
53
|
+
package_name="robotcode.runner.rebot",
|
|
54
|
+
prog_name="RobotCode rebot",
|
|
55
55
|
message=f"%(prog)s %(version)s\n{USAGE.splitlines()[0].split(' -- ')[0].strip()} {get_full_version()}",
|
|
56
56
|
)
|
|
57
57
|
@click.argument("robot_options_and_args", nargs=-1, type=click.Path())
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.41.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotcode_runner-0.41.0 → robotcode_runner-0.43.1}/src/robotcode/runner/cli/discover/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|