-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add support for MicroPython (#27)
- Loading branch information
Showing
8 changed files
with
154 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Running on MicroPython | ||
|
||
The module is designed for [MicroPython]. You can run it on embedded systems, | ||
and, thanks to the [MicroPython UNIX and Windows port], also on Linux, macOS, | ||
and Windows. | ||
|
||
While MicroPython on a workstation does not provide hardware support usually | ||
available when running MicroPython on embedded devices, this is mostly not | ||
a concern when running a database driver. | ||
|
||
|
||
## Embedded | ||
|
||
Todo. | ||
|
||
|
||
## Workstation | ||
|
||
### Setup | ||
|
||
Install MicroPython. | ||
```shell | ||
{apt,brew,pip,zypper} install micropython | ||
``` | ||
|
||
Install requirements. | ||
```shell | ||
micropython -m mip install base64 requests | ||
``` | ||
|
||
## Usage | ||
|
||
Start CrateDB. | ||
```shell | ||
docker run --rm -it --name=cratedb \ | ||
--publish=4200:4200 --publish=5432:5432 \ | ||
--env=CRATE_HEAP_SIZE=2g crate:latest -Cdiscovery.type=single-node | ||
``` | ||
|
||
Invoke example programs. | ||
```shell | ||
export MICROPYPATH=".frozen:${HOME}/.micropython/lib:/usr/lib/micropython:$(pwd)" | ||
micropython examples/example_usage.py | ||
micropython examples/object_examples.py | ||
``` | ||
|
||
|
||
[MicroPython]: https://en.wikipedia.org/wiki/Micropython | ||
[MicroPython UNIX and Windows port]: https://docs.micropython.org/en/latest/unix/quickref.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ruff: noqa: S605, S607 | ||
import os | ||
|
||
|
||
def example_usage(): | ||
""" | ||
Validate `examples/example_usage.py` runs to completion. | ||
""" | ||
assert os.system("micropython examples/example_usage.py") == 0 | ||
|
||
|
||
def object_examples(): | ||
""" | ||
Validate `examples/object_examples.py` runs to completion. | ||
""" | ||
assert os.system("micropython examples/object_examples.py") == 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
example_usage() | ||
object_examples() |