mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-13 18:14:36 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6640fba104 | ||
|
|
ecbfbcfccc | ||
|
|
eff6eaa253 |
@@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 1.5.0 - 2022-12-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Added `ujson` and `ustruct` modules.
|
||||||
|
|
||||||
## 1.4.0 - 2022-12-02
|
## 1.4.0 - 2022-12-02
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pybricks_jedi"
|
name = "pybricks_jedi"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
description = "Code completion for Pybricks."
|
description = "Code completion for Pybricks."
|
||||||
authors = ["The Pybricks Authors"]
|
authors = ["The Pybricks Authors"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ PYBRICKS_CODE_PACKAGES = {
|
|||||||
"pybricks.tools",
|
"pybricks.tools",
|
||||||
"uerrno",
|
"uerrno",
|
||||||
"uio",
|
"uio",
|
||||||
|
"ujson",
|
||||||
"umath",
|
"umath",
|
||||||
"urandom",
|
"urandom",
|
||||||
"uselect",
|
"uselect",
|
||||||
|
"ustruct",
|
||||||
"usys",
|
"usys",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ def test_from():
|
|||||||
"pybricks",
|
"pybricks",
|
||||||
"uerrno",
|
"uerrno",
|
||||||
"uio",
|
"uio",
|
||||||
|
"ujson",
|
||||||
"umath",
|
"umath",
|
||||||
"urandom",
|
"urandom",
|
||||||
"uselect",
|
"uselect",
|
||||||
|
"ustruct",
|
||||||
"usys",
|
"usys",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -186,6 +188,19 @@ def test_from_uio_import():
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def test_from_ujson_import():
|
||||||
|
code = "from ujson import "
|
||||||
|
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
||||||
|
assert [c["insertText"] for c in completions] == [
|
||||||
|
"decode", # FIXME: Shouldn't be here
|
||||||
|
"dump",
|
||||||
|
"dumps",
|
||||||
|
"encode", # FIXME: Shouldn't be here
|
||||||
|
"load",
|
||||||
|
"loads",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_from_umath_import():
|
def test_from_umath_import():
|
||||||
code = "from umath import "
|
code = "from umath import "
|
||||||
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
||||||
@@ -247,6 +262,18 @@ def test_from_uselect_import():
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def test_from_ustruct_import():
|
||||||
|
code = "from ustruct import "
|
||||||
|
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
||||||
|
assert [c["insertText"] for c in completions] == [
|
||||||
|
"calcsize",
|
||||||
|
"pack",
|
||||||
|
"pack_into",
|
||||||
|
"unpack",
|
||||||
|
"unpack_from",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_from_usys_import():
|
def test_from_usys_import():
|
||||||
code = "from usys import "
|
code = "from usys import "
|
||||||
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
|
## 1.5.0 - 2022-12-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Updated `pybricks_jedi` Python package to v1.5.0.
|
||||||
|
|
||||||
## 1.4.0 - 2022-12-02
|
## 1.4.0 - 2022-12-02
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ BUILD_DIR = (pathlib.Path(__file__).parent / "build").resolve()
|
|||||||
|
|
||||||
package_json = {
|
package_json = {
|
||||||
"name": "@pybricks/jedi",
|
"name": "@pybricks/jedi",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"description": "Binary distribution of pybricks-jedi Python package and dependencies for use with Pyodide.",
|
"description": "Binary distribution of pybricks-jedi Python package and dependencies for use with Pyodide.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -38,7 +38,7 @@ subprocess.check_call(
|
|||||||
"pip",
|
"pip",
|
||||||
"download",
|
"download",
|
||||||
"--only-binary=any",
|
"--only-binary=any",
|
||||||
"pybricks-jedi==1.4.0",
|
"pybricks-jedi==1.5.0",
|
||||||
],
|
],
|
||||||
cwd=BUILD_DIR,
|
cwd=BUILD_DIR,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ packages = [
|
|||||||
{ include = "micropython", from = "src" },
|
{ include = "micropython", from = "src" },
|
||||||
{ include = "uerrno", from = "src" },
|
{ include = "uerrno", from = "src" },
|
||||||
{ include = "uio", from = "src" },
|
{ include = "uio", from = "src" },
|
||||||
|
{ include = "ujson", from = "src" },
|
||||||
{ include = "umath", from = "src" },
|
{ include = "umath", from = "src" },
|
||||||
{ include = "urandom", from = "src" },
|
{ include = "urandom", from = "src" },
|
||||||
{ include = "uselect", from = "src" },
|
{ include = "uselect", from = "src" },
|
||||||
|
{ include = "ustruct", from = "src" },
|
||||||
{ include = "usys", from = "src" },
|
{ include = "usys", from = "src" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ Convert between Python objects and the JSON data format.
|
|||||||
|
|
||||||
from typing import IO, Any, Tuple
|
from typing import IO, Any, Tuple
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
json.dump
|
|
||||||
|
|
||||||
|
|
||||||
def dump(object: Any, stream: IO, separators: Tuple[str, str] = (", ", ": ")):
|
def dump(object: Any, stream: IO, separators: Tuple[str, str] = (", ", ": ")):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user