mposcli 0.5.0__tar.gz → 0.6.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.
- {mposcli-0.5.0 → mposcli-0.6.0}/PKG-INFO +31 -5
- {mposcli-0.5.0 → mposcli-0.6.0}/README.md +30 -4
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/__init__.py +1 -1
- mposcli-0.6.0/mposcli/cli_app/shell.py +45 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/test_readme.py +13 -1
- {mposcli-0.5.0 → mposcli-0.6.0}/.editorconfig +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.github/workflows/tests.yml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.gitignore +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.idea/.gitignore +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.pre-commit-config.yaml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.pre-commit-hooks.yaml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/Template Python tests.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/Template Python.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/Unittests __all__.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/cli --help.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/dev-cli --help.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.run/dev-cli test.run.xml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.venv-app/.gitignore +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/.venv-app/lib/python3.14/site-packages/cli_base/tests/shell_complete_snapshots/.gitignore +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/cli.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/dev-cli.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/dist/.gitignore +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/__main__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/__init__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/build.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/copy_mpos.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/flash.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/run_deskop.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_app/update.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/__init__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/__main__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/code_style.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/packaging.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/shell_completion.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/testing.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/cli_dev/update_readme_history.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/constants.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/fs_utils.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/mpos_utils.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/__init__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/test_doctests.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/test_mpremote_cp_utils.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/test_project_setup.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tests/test_readme_history.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/tools.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/user_input.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/utilities/__init__.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/mposcli/utilities/mpremote.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/noxfile.py +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/pyproject.toml +0 -0
- {mposcli-0.5.0 → mposcli-0.6.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mposcli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: CLI helper for MicroPythonOS: https://github.com/MicroPythonOS/MicroPythonOS
|
|
5
5
|
Project-URL: Documentation, https://github.com/jedie/mposcli
|
|
6
6
|
Project-URL: Source, https://github.com/jedie/mposcli
|
|
@@ -47,7 +47,8 @@ cd ~/MicroPythonOS
|
|
|
47
47
|
|
|
48
48
|
[comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
|
|
49
49
|
```
|
|
50
|
-
usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,update,update-
|
|
50
|
+
usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,shell,update,update-
|
|
51
|
+
submodules,version}
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
|
|
@@ -74,6 +75,9 @@ usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,update,update-submodules,
|
|
|
74
75
|
│ opythonos.com/os-development/installing-on-esp32/ │
|
|
75
76
|
│ • run-desktop Run MicroPythonOS on desktop. see: https://docs.micropythonos.c │
|
|
76
77
|
│ om/getting-started/running/#running-on-desktop │
|
|
78
|
+
│ • shell Start a REPL shell connected to the device using mpremote. │
|
|
79
|
+
│ Optional reset before starting the REPL. The goal it to try to │
|
|
80
|
+
│ get a REPL in a loop until it works. │
|
|
77
81
|
│ • update Update MicroPythonOS repository. Assume that there is a │
|
|
78
82
|
│ "origin" and/or "upstream" remote configured. Will also ask if │
|
|
79
83
|
│ you want to update the submodules as well, which is │
|
|
@@ -215,6 +219,26 @@ started/running/#running-on-desktop
|
|
|
215
219
|
|
|
216
220
|
|
|
217
221
|
|
|
222
|
+
## mposcli shell
|
|
223
|
+
|
|
224
|
+
[comment]: <> (✂✂✂ auto generated shell start ✂✂✂)
|
|
225
|
+
```
|
|
226
|
+
usage: mposcli shell [-h] [--reset | --no-reset] [-v]
|
|
227
|
+
|
|
228
|
+
Start a REPL shell connected to the device using mpremote. Optional reset before starting
|
|
229
|
+
the REPL. The goal it to try to get a REPL in a loop until it works.
|
|
230
|
+
|
|
231
|
+
╭─ options ────────────────────────────────────────────────────────────────────────╮
|
|
232
|
+
│ -h, --help show this help message and exit │
|
|
233
|
+
│ --reset, --no-reset Reset the device before starting the REPL? (default: False) │
|
|
234
|
+
│ -v, --verbosity Verbosity level; e.g.: -v, -vv, -vvv, etc. (repeatable) │
|
|
235
|
+
╰──────────────────────────────────────────────────────────────────────────────────╯
|
|
236
|
+
```
|
|
237
|
+
[comment]: <> (✂✂✂ auto generated shell end ✂✂✂)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
218
242
|
## mposcli update
|
|
219
243
|
|
|
220
244
|
|
|
@@ -319,6 +343,8 @@ completion,test,update,update-readme-history,update-test-snapshot-files,version}
|
|
|
319
343
|
|
|
320
344
|
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
|
|
321
345
|
|
|
346
|
+
* [v0.6.0](https://github.com/jedie/mposcli/compare/v0.5.0...v0.6.0)
|
|
347
|
+
* 2026-03-21 - NEW: "shell" to start the REPL
|
|
322
348
|
* [v0.5.0](https://github.com/jedie/mposcli/compare/v0.4.1...v0.5.0)
|
|
323
349
|
* 2026-03-08 - update README
|
|
324
350
|
* 2026-03-05 - Enhance "cp" command and auto restart "mpremote repl"
|
|
@@ -332,13 +358,13 @@ completion,test,update,update-readme-history,update-test-snapshot-files,version}
|
|
|
332
358
|
* 2026-02-23 - Update requirements and fix code style
|
|
333
359
|
* 2026-02-23 - "build" command: target as positional argument
|
|
334
360
|
* 2026-02-23 - Expand "cp" command and allow optional filesystem path
|
|
361
|
+
|
|
362
|
+
<details><summary>Expand older history entries ...</summary>
|
|
363
|
+
|
|
335
364
|
* [v0.3.0](https://github.com/jedie/mposcli/compare/v0.2.0...v0.3.0)
|
|
336
365
|
* 2026-02-18 - Add "update" beside "update-submodules"
|
|
337
366
|
* 2026-02-17 - Update requirements
|
|
338
367
|
* 2026-02-16 - update README
|
|
339
|
-
|
|
340
|
-
<details><summary>Expand older history entries ...</summary>
|
|
341
|
-
|
|
342
368
|
* [v0.2.0](https://github.com/jedie/mposcli/compare/v0.1.0...v0.2.0)
|
|
343
369
|
* 2026-02-16 - New CLI command: "cp" with convenience features.
|
|
344
370
|
* 2026-02-16 - New command: "flash" with file selector
|
|
@@ -32,7 +32,8 @@ cd ~/MicroPythonOS
|
|
|
32
32
|
|
|
33
33
|
[comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
|
|
34
34
|
```
|
|
35
|
-
usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,update,update-
|
|
35
|
+
usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,shell,update,update-
|
|
36
|
+
submodules,version}
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
|
|
@@ -59,6 +60,9 @@ usage: mposcli [-h] {build,cp,cp-app,flash,run-desktop,update,update-submodules,
|
|
|
59
60
|
│ opythonos.com/os-development/installing-on-esp32/ │
|
|
60
61
|
│ • run-desktop Run MicroPythonOS on desktop. see: https://docs.micropythonos.c │
|
|
61
62
|
│ om/getting-started/running/#running-on-desktop │
|
|
63
|
+
│ • shell Start a REPL shell connected to the device using mpremote. │
|
|
64
|
+
│ Optional reset before starting the REPL. The goal it to try to │
|
|
65
|
+
│ get a REPL in a loop until it works. │
|
|
62
66
|
│ • update Update MicroPythonOS repository. Assume that there is a │
|
|
63
67
|
│ "origin" and/or "upstream" remote configured. Will also ask if │
|
|
64
68
|
│ you want to update the submodules as well, which is │
|
|
@@ -200,6 +204,26 @@ started/running/#running-on-desktop
|
|
|
200
204
|
|
|
201
205
|
|
|
202
206
|
|
|
207
|
+
## mposcli shell
|
|
208
|
+
|
|
209
|
+
[comment]: <> (✂✂✂ auto generated shell start ✂✂✂)
|
|
210
|
+
```
|
|
211
|
+
usage: mposcli shell [-h] [--reset | --no-reset] [-v]
|
|
212
|
+
|
|
213
|
+
Start a REPL shell connected to the device using mpremote. Optional reset before starting
|
|
214
|
+
the REPL. The goal it to try to get a REPL in a loop until it works.
|
|
215
|
+
|
|
216
|
+
╭─ options ────────────────────────────────────────────────────────────────────────╮
|
|
217
|
+
│ -h, --help show this help message and exit │
|
|
218
|
+
│ --reset, --no-reset Reset the device before starting the REPL? (default: False) │
|
|
219
|
+
│ -v, --verbosity Verbosity level; e.g.: -v, -vv, -vvv, etc. (repeatable) │
|
|
220
|
+
╰──────────────────────────────────────────────────────────────────────────────────╯
|
|
221
|
+
```
|
|
222
|
+
[comment]: <> (✂✂✂ auto generated shell end ✂✂✂)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
203
227
|
## mposcli update
|
|
204
228
|
|
|
205
229
|
|
|
@@ -304,6 +328,8 @@ completion,test,update,update-readme-history,update-test-snapshot-files,version}
|
|
|
304
328
|
|
|
305
329
|
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
|
|
306
330
|
|
|
331
|
+
* [v0.6.0](https://github.com/jedie/mposcli/compare/v0.5.0...v0.6.0)
|
|
332
|
+
* 2026-03-21 - NEW: "shell" to start the REPL
|
|
307
333
|
* [v0.5.0](https://github.com/jedie/mposcli/compare/v0.4.1...v0.5.0)
|
|
308
334
|
* 2026-03-08 - update README
|
|
309
335
|
* 2026-03-05 - Enhance "cp" command and auto restart "mpremote repl"
|
|
@@ -317,13 +343,13 @@ completion,test,update,update-readme-history,update-test-snapshot-files,version}
|
|
|
317
343
|
* 2026-02-23 - Update requirements and fix code style
|
|
318
344
|
* 2026-02-23 - "build" command: target as positional argument
|
|
319
345
|
* 2026-02-23 - Expand "cp" command and allow optional filesystem path
|
|
346
|
+
|
|
347
|
+
<details><summary>Expand older history entries ...</summary>
|
|
348
|
+
|
|
320
349
|
* [v0.3.0](https://github.com/jedie/mposcli/compare/v0.2.0...v0.3.0)
|
|
321
350
|
* 2026-02-18 - Add "update" beside "update-submodules"
|
|
322
351
|
* 2026-02-17 - Update requirements
|
|
323
352
|
* 2026-02-16 - update README
|
|
324
|
-
|
|
325
|
-
<details><summary>Expand older history entries ...</summary>
|
|
326
|
-
|
|
327
353
|
* [v0.2.0](https://github.com/jedie/mposcli/compare/v0.1.0...v0.2.0)
|
|
328
354
|
* 2026-02-16 - New CLI command: "cp" with convenience features.
|
|
329
355
|
* 2026-02-16 - New command: "flash" with file selector
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import time
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
5
|
+
import tyro
|
|
6
|
+
from cli_base.cli_tools.subprocess_utils import verbose_check_call
|
|
7
|
+
from cli_base.cli_tools.verbosity import setup_logging
|
|
8
|
+
from cli_base.tyro_commands import TyroVerbosityArgType
|
|
9
|
+
|
|
10
|
+
from mposcli.cli_app import app
|
|
11
|
+
from mposcli.mpos_utils import get_mpos_path
|
|
12
|
+
from mposcli.tools import get_mpremote_bin
|
|
13
|
+
from mposcli.utilities.mpremote import start_mpremote_repl
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@app.command
|
|
20
|
+
def shell(
|
|
21
|
+
reset: Annotated[
|
|
22
|
+
bool,
|
|
23
|
+
tyro.conf.arg(help='Reset the device before starting the REPL?'),
|
|
24
|
+
] = False,
|
|
25
|
+
verbosity: TyroVerbosityArgType = 1,
|
|
26
|
+
):
|
|
27
|
+
"""
|
|
28
|
+
Start a REPL shell connected to the device using mpremote. Optional reset before starting the REPL.
|
|
29
|
+
The goal it to try to get a REPL in a loop until it works.
|
|
30
|
+
"""
|
|
31
|
+
setup_logging(verbosity=verbosity)
|
|
32
|
+
mpos_path = get_mpos_path()
|
|
33
|
+
mpremote_bin = get_mpremote_bin()
|
|
34
|
+
|
|
35
|
+
if reset:
|
|
36
|
+
time.sleep(1)
|
|
37
|
+
verbose_check_call(
|
|
38
|
+
mpremote_bin,
|
|
39
|
+
'reset',
|
|
40
|
+
verbose=True,
|
|
41
|
+
cwd=mpos_path,
|
|
42
|
+
text=None,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
start_mpremote_repl()
|
|
@@ -83,7 +83,19 @@ class ReadmeTestCase(BaseTestCase):
|
|
|
83
83
|
|
|
84
84
|
commands.discard('version') # version is pseudo command, because the version always printed on every CLI call
|
|
85
85
|
commands = sorted(commands)
|
|
86
|
-
self.assertEqual(
|
|
86
|
+
self.assertEqual(
|
|
87
|
+
commands,
|
|
88
|
+
[
|
|
89
|
+
'build',
|
|
90
|
+
'cp',
|
|
91
|
+
'cp-app',
|
|
92
|
+
'flash',
|
|
93
|
+
'run-desktop',
|
|
94
|
+
'shell',
|
|
95
|
+
'update',
|
|
96
|
+
'update-submodules',
|
|
97
|
+
],
|
|
98
|
+
)
|
|
87
99
|
|
|
88
100
|
for command in commands:
|
|
89
101
|
with self.subTest(command):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|