Skip to content

Commit d0f71fe

Browse files
committed
refactor: some big refactoring, introdude robotcode.runner project
1 parent 48aef63 commit d0f71fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+680
-81
lines changed

.vscode/launch.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,40 @@
55
{
66
"version": "0.2.0",
77
"configurations": [
8+
{
9+
"name": "Python: RobotCode.Runner",
10+
"type": "python",
11+
"request": "launch",
12+
"module": "robotcode.runner",
13+
"justMyCode": false,
14+
"cwd": "${workspaceFolder}/tests/robotcode/language_server/robotframework/parts/data",
15+
"args": [
16+
"tests1"
17+
]
18+
// "args": [
19+
// "-d",
20+
// "results",
21+
// "-P",
22+
// "./lib",
23+
// "-P",
24+
// "resources",
25+
// "-v",
26+
// "NAME:value",
27+
// "--dryrun",
28+
// "tests"
29+
// ]
30+
},
31+
{
32+
"name": "Python: RobotCode",
33+
"type": "python",
34+
"request": "launch",
35+
"module": "robotcode.cli",
36+
"justMyCode": false,
37+
"args": [
38+
"run",
39+
"--help"
40+
]
41+
},
842
{
943
"name": "Python: Attach using Process Id",
1044
"type": "python",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
[![PyPI - Version](https://img.shields.io/pypi/v/robotcode.svg?style=flat)](https://pypi.org/project/robotcode)
99
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/robotcode.svg?style=flat)](https://pypi.org/project/robotcode)
10+
[![PyPI - Downloads](https://img.shields.io/pypi/dm/robotcode.svg?style=flat&label=downloads)](https://pypi.org/project/robotcode/)
1011

1112
----
1213

bundled/tool/check_robot_version.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:
1717

1818

1919
if __name__ == "__main__":
20-
# Ensure that we can import LSP libraries, and other bundled libraries.
2120
update_sys_path(
2221
os.fspath(pathlib.Path(__file__).parent.parent / "libs"),
2322
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),
2423
)
2524

26-
# Run the language server.
2725
from robotcode.language_server.robotframework.utils.version import get_robot_version
2826

2927
print(get_robot_version() >= (4, 0))

bundled/tool/cli/__init__.py

Whitespace-only changes.

bundled/tool/cli/__main__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
import pathlib
3+
import site
4+
import sys
5+
6+
7+
def update_sys_path(path_to_add: str, strategy: str) -> None:
8+
if path_to_add not in sys.path and pathlib.Path(path_to_add).is_dir():
9+
if any(p for p in pathlib.Path(path_to_add).iterdir() if p.suffix == ".pth"):
10+
site.addsitedir(path_to_add)
11+
return
12+
13+
if strategy == "useBundled":
14+
sys.path.insert(0, path_to_add)
15+
elif strategy == "fromEnvironment":
16+
sys.path.append(path_to_add)
17+
18+
19+
if __name__ == "__main__":
20+
update_sys_path(
21+
os.fspath(pathlib.Path(__file__).parent.parent.parent / "libs"),
22+
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),
23+
)
24+
25+
from robotcode.cli import robotcode
26+
27+
sys.exit(robotcode())

bundled/tool/debugger/launcher/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:
1717

1818

1919
if __name__ == "__main__":
20-
# Ensure that we can import LSP libraries, and other bundled libraries.
2120
update_sys_path(
2221
os.fspath(pathlib.Path(__file__).parent.parent.parent.parent / "libs"),
2322
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),

bundled/tool/language_server/__main__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:
1717

1818

1919
if __name__ == "__main__":
20-
# Ensure that we can import LSP libraries, and other bundled libraries.
2120
update_sys_path(
2221
os.fspath(pathlib.Path(__file__).parent.parent.parent / "libs"),
2322
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),
2423
)
2524

26-
# Run the language server.
2725
from robotcode.language_server.cli import main
2826

2927
main()

bundled_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
click>=8.1.0
2+
pluggy>=1.0.0

packages/core/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# robotcode-utils
1+
# robotcode-core
22

33
[![PyPI - Version](https://img.shields.io/pypi/v/robotcode-core.svg)](https://pypi.org/project/robotcode-core)
44
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/robotcode-core.svg)](https://pypi.org/project/robotcode-core)
@@ -18,4 +18,4 @@ pip install robotcode-core
1818

1919
## License
2020

21-
`robotcode-utils` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
21+
`robotcode-core` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.

packages/core/robotcode/core/async_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
runtime_checkable,
3333
)
3434

35-
from robotcode.core.inspect import ensure_coroutine
35+
from robotcode.core.utils.inspect import ensure_coroutine
3636

3737
_T = TypeVar("_T")
3838

0 commit comments

Comments
 (0)