diff --git a/.github/workflows/release_artifacts.yml b/.github/workflows/release_artifacts.yml index 08e9f76..ca0d1be 100644 --- a/.github/workflows/release_artifacts.yml +++ b/.github/workflows/release_artifacts.yml @@ -21,7 +21,6 @@ jobs: - name: Compile skyportal lib run: | - python -m pip install mpy-cross python ./compile.py - name: Build base bundle diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a878d5..9d42a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ # Changelog Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (``.``.``) + +## [v1.0.0] +Initial release 🎉 diff --git a/README.md b/README.md index bccced9..83d9a21 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Thank you to [markleoart](https://www.fiverr.com/markleoart) for creating the ai ## Getting Started Users are assumed have read through [Adafruit's PyPortal learning guide](https://learn.adafruit.com/adafruit-pyportal). CircuitPython v8.2 is currently in use for this repository, no other versions are evaluated. +The CircuitPython libraries in `lib` are sourced from the Official and Community bundles, which can be found on the [CircuitPython libraries page](https://learn.adafruit.com/adafruit-pyportal) + **WARNING:** In order to generate the background map tile, this project's `boot.py` modifies the boot process to allow the filesystem to be used as a writeable cache. In the unlikely event that things go horribly awry you may lose the existing contents of your device, so be sure to back them up before working with this project. ### Installation @@ -27,9 +29,10 @@ secrets.py ``` #### From GH Release -The Skyportal [Releases page](https://github.com/sco1/skyportal/releases) contains bundled `*.tar.gz` archives, built in CI, that can be downloaded and extracted directly onto the device. Bundles come in two flavors: one pure-python implementation and one compiled `*.mpy` version, which has a decreased overall file size. +The Skyportal [Releases page](https://github.com/sco1/skyportal/releases) contains bundled `*.tar.gz` archives, built in CI, that can be downloaded and extracted directly onto the device. Bundles come in two flavors: one pure-python implementation and a compiled version, where the `skyportal` library has been [compiled to `*.mpy`](https://learn.adafruit.com/welcome-to-circuitpython/library-file-types-and-frozen-libraries#dot-mpy-library-files-3117643) and added to `lib/`. -### Secrets +### Configuration +#### Secrets The following secrets are required for functionality: ```py @@ -50,13 +53,13 @@ secrets = { } ``` -### Constants +#### Constants A collection of functionality-related constants is specified in `constants.py`, which can be adjusted to suit your needs: -| Variable Name | Description | Default | -|----------------------------|-----------------------------------------------|----------| -| `MAP_CENTER_LAT` | Map center latitude, decimal degrees | `42.41` | -| `MAP_CENTER_LON` | Map center longitude, deimal degrees | `-71.17` | -| `GRID_WIDTH_MI` | Map grid width, miles | `15` | -| `SKIP_GROUND` | Skip drawing aircraft on the ground | `True` | -| `GEO_ALTITUDE_THRESHOLD_M` | Skip drawing aircraft below this GPS altitude | `20` | +| Variable Name | Description | Default | +|----------------------------|-------------------------------------------------------|----------| +| `MAP_CENTER_LAT` | Map center latitude, decimal degrees | `42.41` | +| `MAP_CENTER_LON` | Map center longitude, deimal degrees | `-71.17` | +| `GRID_WIDTH_MI` | Map grid width, miles | `15` | +| `SKIP_GROUND` | Skip drawing aircraft on the ground | `True` | +| `GEO_ALTITUDE_THRESHOLD_M` | Skip drawing aircraft below this GPS altitude, meters | `20` | diff --git a/compile.py b/compile.py index 7b5f8f9..1aabfbe 100644 --- a/compile.py +++ b/compile.py @@ -1,11 +1,17 @@ +import platform +import subprocess import time from pathlib import Path -import mpy_cross - SOURCE_DIR = Path("./skyportal") DEST_DIR = Path("./dist/lib/skyportal") +COMPILERS = { + "Windows": Path("./mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe"), + "Linux": Path("./mpy-cross/mpy-cross.static-amd64-linux-8.0.5"), + "Darwin": Path("./mpy-cross/mpy-cross-macos-11-8.0.5-arm64"), +} + if __name__ == "__main__": DEST_DIR.mkdir(parents=True, exist_ok=True) @@ -13,7 +19,7 @@ to_compile = list(SOURCE_DIR.glob("*.py")) print(f"Found {len(to_compile)} *.py files to compile") for filepath in to_compile: - mpy_cross.run(filepath) + subprocess.run([COMPILERS[platform.system()], filepath]) time.sleep(1) # Lazy wait for subprocesses to finish diff --git a/mpy-cross/README.md b/mpy-cross/README.md new file mode 100644 index 0000000..6b7a39d --- /dev/null +++ b/mpy-cross/README.md @@ -0,0 +1 @@ +mpy-cross binaries sourced from S3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/ diff --git a/mpy-cross/mpy-cross-macos-11-8.0.5-arm64 b/mpy-cross/mpy-cross-macos-11-8.0.5-arm64 new file mode 100755 index 0000000..5b5ec70 Binary files /dev/null and b/mpy-cross/mpy-cross-macos-11-8.0.5-arm64 differ diff --git a/mpy-cross/mpy-cross.static-amd64-linux-8.0.5 b/mpy-cross/mpy-cross.static-amd64-linux-8.0.5 new file mode 100755 index 0000000..26145b1 Binary files /dev/null and b/mpy-cross/mpy-cross.static-amd64-linux-8.0.5 differ diff --git a/mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe b/mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe new file mode 100755 index 0000000..598d42a Binary files /dev/null and b/mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe differ diff --git a/poetry.lock b/poetry.lock index 430a764..ad131ca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -249,22 +249,6 @@ files = [ {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] -[[package]] -name = "mpy-cross" -version = "1.20.0" -description = "micropython mpy-cross distribution" -optional = false -python-versions = "*" -files = [ - {file = "mpy_cross-1.20.0-py2.py3-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:8161edb01c0b7eda6a70c85301615f076fae329e038cc7d5c42865a13535a2a8"}, - {file = "mpy_cross-1.20.0-py2.py3-none-manylinux1_i686.whl", hash = "sha256:f34f6b29486a45ded52e9525692a0db925d4d61e50c8620e5f979dd21e8fcb7e"}, - {file = "mpy_cross-1.20.0-py2.py3-none-manylinux1_x86_64.whl", hash = "sha256:cd5dc8c00e58c4fde3330c3bb3ee66d1e12749a983d14ab58784002c5e52ec90"}, - {file = "mpy_cross-1.20.0-py2.py3-none-manylinux2014_aarch64.whl", hash = "sha256:09f9d28b103468aad3d243e7767ad216e5a169f63acbd3a3dd21eac57ebb703a"}, - {file = "mpy_cross-1.20.0-py2.py3-none-manylinux2014_armv7l.whl", hash = "sha256:04f0ad333a168cbe2f6a9753f2d74bcf89d6ced25e14cef2585fd154d7975e09"}, - {file = "mpy_cross-1.20.0-py2.py3-none-win32.whl", hash = "sha256:08fc7808abecc4586a03d3a9e519c9f7f257aa865b77aad40e5948a52c81b14b"}, - {file = "mpy_cross-1.20.0-py2.py3-none-win_amd64.whl", hash = "sha256:074fb79da38ca699440cb9001ffbe2e84dab33256349e589c457ac5ea7fe5ada"}, -] - [[package]] name = "mypy" version = "1.6.1" @@ -553,4 +537,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "6137e7da0868fc6f6c58b2b0f53329f1b5f7f066bad2d24e1da44748ae2378e1" +content-hash = "6ff3ed83f2d2b708ca0101af12ddea5aa86f2480b3256fa2883c4a01aa5a2fcb" diff --git a/pyproject.toml b/pyproject.toml index 195fbef..4ac5e52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,6 @@ flake8-bugbear = "^23.1" flake8-docstrings = "^1.7" flake8-fixme = "^1.1" isort = "^5.12" -mpy-cross = "^1.20" mypy = "^1.0" pep8-naming = "^0.13" pre-commit = "^3.0"