robotcode-repl-server 2.6.2__tar.gz → 2.8.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.
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/.gitignore +4 -1
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/PKG-INFO +5 -4
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/pyproject.toml +3 -2
- robotcode_repl_server-2.8.0/src/robotcode/repl_server/__version__.py +1 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/cli.py +36 -11
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/interpreter.py +16 -1
- robotcode_repl_server-2.6.2/src/robotcode/repl_server/__version__.py +0 -1
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/README.md +0 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/__init__.py +0 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/hooks.py +0 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/protocol.py +0 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/py.typed +0 -0
- {robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/server.py +0 -0
|
@@ -279,6 +279,9 @@ dist
|
|
|
279
279
|
# vuepress build output
|
|
280
280
|
.vuepress/dist
|
|
281
281
|
|
|
282
|
+
# Astro (documentation site)
|
|
283
|
+
docs/.astro/
|
|
284
|
+
|
|
282
285
|
# Serverless directories
|
|
283
286
|
.serverless/
|
|
284
287
|
|
|
@@ -339,7 +342,7 @@ bundled/libs
|
|
|
339
342
|
# .agents
|
|
340
343
|
.agents/
|
|
341
344
|
skills-lock.json
|
|
342
|
-
|
|
345
|
+
#.claude
|
|
343
346
|
|
|
344
347
|
# sarif files
|
|
345
348
|
/**/*.sarif.json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: robotcode-repl-server
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.0
|
|
4
4
|
Summary: RobotCode REPL Server for Robot Framework
|
|
5
5
|
Project-URL: Homepage, https://robotcode.io
|
|
6
6
|
Project-URL: Donate, https://opencollective.com/robotcode
|
|
@@ -20,13 +20,14 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
24
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
24
25
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
25
26
|
Classifier: Topic :: Utilities
|
|
26
27
|
Classifier: Typing :: Typed
|
|
27
28
|
Requires-Python: >=3.10
|
|
28
|
-
Requires-Dist: robotcode-jsonrpc2==2.
|
|
29
|
-
Requires-Dist: robotcode-runner==2.
|
|
29
|
+
Requires-Dist: robotcode-jsonrpc2==2.8.0
|
|
30
|
+
Requires-Dist: robotcode-runner==2.8.0
|
|
30
31
|
Description-Content-Type: text/markdown
|
|
31
32
|
|
|
32
33
|
# robotcode-repl-server
|
|
@@ -18,6 +18,7 @@ classifiers = [
|
|
|
18
18
|
"Programming Language :: Python :: 3.12",
|
|
19
19
|
"Programming Language :: Python :: 3.13",
|
|
20
20
|
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Programming Language :: Python :: 3.15",
|
|
21
22
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
22
23
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
23
24
|
"Operating System :: OS Independent",
|
|
@@ -28,8 +29,8 @@ classifiers = [
|
|
|
28
29
|
]
|
|
29
30
|
dynamic = ["version"]
|
|
30
31
|
dependencies = [
|
|
31
|
-
"robotcode-jsonrpc2==2.
|
|
32
|
-
"robotcode-runner==2.
|
|
32
|
+
"robotcode-jsonrpc2==2.8.0",
|
|
33
|
+
"robotcode-runner==2.8.0"
|
|
33
34
|
]
|
|
34
35
|
|
|
35
36
|
[project.entry-points.robotcode]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.8.0"
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/cli.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import threading
|
|
3
3
|
import time
|
|
4
|
+
from concurrent.futures import wait
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
from typing import Any, Optional, Sequence, Tuple
|
|
6
7
|
|
|
@@ -14,7 +15,9 @@ from robotcode.plugin.click_helper.options import (
|
|
|
14
15
|
server_options,
|
|
15
16
|
)
|
|
16
17
|
from robotcode.plugin.click_helper.types import AddressesPort, add_options
|
|
18
|
+
from robotcode.plugin.click_helper.wrappable import wrappable
|
|
17
19
|
from robotcode.repl.run import run_repl
|
|
20
|
+
from robotcode.runner.cli.robot import load_robot_profile
|
|
18
21
|
|
|
19
22
|
from .__version__ import __version__
|
|
20
23
|
from .interpreter import Interpreter
|
|
@@ -80,9 +83,14 @@ def run_jsonrpc_server(
|
|
|
80
83
|
) -> None:
|
|
81
84
|
loop = asyncio.new_event_loop()
|
|
82
85
|
asyncio.set_event_loop(loop)
|
|
83
|
-
|
|
86
|
+
try:
|
|
87
|
+
run_jsonrpc_server_async(mode, port, bind, pipe_name, interpreter)
|
|
88
|
+
finally:
|
|
89
|
+
# closed here, not by the garbage collector at exit, which can fail with a traceback on Python 3.11
|
|
90
|
+
loop.close()
|
|
84
91
|
|
|
85
92
|
|
|
93
|
+
@wrappable
|
|
86
94
|
@click.command(
|
|
87
95
|
context_settings={"allow_extra_args": True, "ignore_unknown_options": True},
|
|
88
96
|
add_help_option=True,
|
|
@@ -154,11 +162,11 @@ def run_jsonrpc_server(
|
|
|
154
162
|
"--source",
|
|
155
163
|
type=click.Path(path_type=Path),
|
|
156
164
|
metavar="FILE",
|
|
157
|
-
help="
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"need to exist.",
|
|
165
|
+
help="Run the session as if its keywords were written in FILE: `${CURDIR}` is the "
|
|
166
|
+
"directory of FILE, `${SUITE SOURCE}` is FILE and, on Robot Framework 7.4 and newer, "
|
|
167
|
+
"relative paths in `Import Resource`, `Import Library`, and `Import Variables` resolve "
|
|
168
|
+
"against that directory. A relative FILE is resolved against the directory the command "
|
|
169
|
+
"is started from. The file itself is never read or written, so the path doesn't need to exist.",
|
|
162
170
|
)
|
|
163
171
|
@click.argument(
|
|
164
172
|
"files",
|
|
@@ -195,6 +203,10 @@ def repl_server(
|
|
|
195
203
|
Start a REPL server, client can connect to the server and run the REPL scripts.
|
|
196
204
|
"""
|
|
197
205
|
|
|
206
|
+
# Before the server starts, so that it runs under the `wrapper` too; an error of the
|
|
207
|
+
# configuration shows when `run_repl` uses it, after the server has started.
|
|
208
|
+
load_robot_profile(app, tuple(str(f.absolute()) for f in files))
|
|
209
|
+
|
|
198
210
|
mode, port, bind, pipe_name = resolve_server_options(
|
|
199
211
|
ctx,
|
|
200
212
|
app,
|
|
@@ -211,12 +223,17 @@ def repl_server(
|
|
|
211
223
|
|
|
212
224
|
interpreter = Interpreter(list(files))
|
|
213
225
|
|
|
214
|
-
|
|
226
|
+
# A dry run starts no server; `run_repl` only prints what it would execute.
|
|
227
|
+
server_task = (
|
|
228
|
+
None
|
|
229
|
+
if app.config.dry
|
|
230
|
+
else run_as_debugpy_hidden_task(run_jsonrpc_server, mode, port, bind, pipe_name, interpreter)
|
|
231
|
+
)
|
|
215
232
|
|
|
216
|
-
server = wait_for_server(server_task)
|
|
233
|
+
server = wait_for_server(server_task) if server_task is not None else None
|
|
217
234
|
|
|
218
235
|
try:
|
|
219
|
-
run_repl(
|
|
236
|
+
result = run_repl(
|
|
220
237
|
interpreter=interpreter,
|
|
221
238
|
app=app,
|
|
222
239
|
variable=variable,
|
|
@@ -231,7 +248,15 @@ def repl_server(
|
|
|
231
248
|
files=files,
|
|
232
249
|
)
|
|
233
250
|
finally:
|
|
251
|
+
# Closing stops the server's stdio reader too. It runs on the server's loop, because
|
|
252
|
+
# called from here it waits until all clients of a TCP server have disconnected (from
|
|
253
|
+
# Python 3.12 on). The wait must not raise: an error of the session, such as an
|
|
254
|
+
# invalid robot.toml, has to reach Click unchanged.
|
|
234
255
|
if server is not None:
|
|
235
|
-
server.loop.
|
|
256
|
+
server.loop.call_soon_threadsafe(server.close)
|
|
257
|
+
|
|
258
|
+
if server_task is not None:
|
|
259
|
+
wait([server_task], timeout=1)
|
|
236
260
|
|
|
237
|
-
|
|
261
|
+
if result.exit_code is not None:
|
|
262
|
+
app.exit(result.exit_code)
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/interpreter.py
RENAMED
|
@@ -118,6 +118,8 @@ class Interpreter(BaseInterpreter):
|
|
|
118
118
|
self._interrupted = False
|
|
119
119
|
self._has_shutdown = False
|
|
120
120
|
self._cell_errors: List[str] = []
|
|
121
|
+
# Set while the session waits for a cell: SIGTERM then ends the wait (`_end_waiting`).
|
|
122
|
+
self._waiting = False
|
|
121
123
|
|
|
122
124
|
def shutdown(self) -> None:
|
|
123
125
|
self._code = []
|
|
@@ -270,7 +272,14 @@ class Interpreter(BaseInterpreter):
|
|
|
270
272
|
self._success = True
|
|
271
273
|
|
|
272
274
|
def run_input(self) -> None:
|
|
273
|
-
self.
|
|
275
|
+
self._waiting = True
|
|
276
|
+
try:
|
|
277
|
+
# Checked after marking the wait: a SIGTERM in between can't be missed.
|
|
278
|
+
if self._termination_requested:
|
|
279
|
+
raise EOFError
|
|
280
|
+
self.has_input.wait()
|
|
281
|
+
finally:
|
|
282
|
+
self._waiting = False
|
|
274
283
|
if self._has_shutdown:
|
|
275
284
|
self.executed.set()
|
|
276
285
|
raise EOFError
|
|
@@ -280,3 +289,9 @@ class Interpreter(BaseInterpreter):
|
|
|
280
289
|
finally:
|
|
281
290
|
self.has_input.clear()
|
|
282
291
|
self.executed.set()
|
|
292
|
+
|
|
293
|
+
def _end_waiting(self) -> None:
|
|
294
|
+
# Raised rather than `shutdown()`: setting the event takes a lock that the main
|
|
295
|
+
# thread, interrupted by the signal, may hold.
|
|
296
|
+
if self._waiting:
|
|
297
|
+
raise EOFError
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.6.2"
|
|
File without changes
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/__init__.py
RENAMED
|
File without changes
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/hooks.py
RENAMED
|
File without changes
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/protocol.py
RENAMED
|
File without changes
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/py.typed
RENAMED
|
File without changes
|
{robotcode_repl_server-2.6.2 → robotcode_repl_server-2.8.0}/src/robotcode/repl_server/server.py
RENAMED
|
File without changes
|