Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Feb 27, 2025
1 parent 3a87f44 commit 84e614d
Show file tree
Hide file tree
Showing 47 changed files with 16,417 additions and 1,338 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/integration_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,18 @@ jobs:
fi
cat ubo_app/.env
- uses: actions/setup-node@v4
name: Setup Node
with:
node-version: '20'

- name: Build Web Application
run: |
cd ubo_app/services/090-web-ui/web-app
npm install
npm run proto:compile
npm run build
- name: Build
env:
SETUPTOOLS_SCM_PRETEND_VERSION:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
echo "VERSION=$(uvx hatch version)" >>"$GITHUB_OUTPUT"
echo "VERSION=$(uvx hatch version)"
VERSION=$(uvx hatch version | sed 's/\.dev.*//')
echo "VERSION=$VERSION" >>"$GITHUB_OUTPUT"
echo "VERSION=$VERSION"
- name: Create Release Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "Ubo Admin"
Expand Down
100 changes: 49 additions & 51 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@ readme = "README.md"
requires-python = ">=3.11, <3.12"
keywords = ['ubo', 'ubo-pod', 'raspberry pi', 'rpi', 'home assistance']
dependencies = [
"aiohttp >=3.9.1",
"dill >=0.3.8",
"aiohttp>=3.9.1",
"dill>=0.3.8",
"docker>=7.1.0",
"headless-kivy >=0.12.2",
"headless-kivy>=0.12.2",
"netifaces>=0.11.0",
"platformdirs >=4.2.0",
"psutil >=6.0.0",
"pulsectl >=23.5.2",
"pvorca >=0.2.1",
"platformdirs>=4.2.0",
"psutil>=6.0.0",
"pulsectl>=23.5.2",
"pvorca>=0.2.1",
"pypng>=0.20220715.0",
"python-debouncer >=0.1.5",
"python-dotenv >=1.0.1",
"python-fake >=0.1.3",
"python-redux >=0.18.3",
"python-strtobool >=1.0.0",
"pythonping >=1.1.4",
"pyzbar >=0.1.9",
"quart >=0.19.6",
"rpi_ws281x >=5.0.0 ; platform_machine=='aarch64'",
"sdbus-networkmanager >=2.0.0 ; platform_machine=='aarch64'",
"semver >=3.0.2",
"sentry-sdk >=1.43.0",
"simpleaudio >=1.0.4",
"tenacity >=8.2.3",
"ubo-gui >=0.13.10",
"python-debouncer>=0.1.5",
"python-dotenv>=1.0.1",
"python-fake>=0.1.3",
"python-redux>=0.19.0",
"python-strtobool>=1.0.0",
"pythonping>=1.1.4",
"pyzbar>=0.1.9",
"quart>=0.19.6",
"rpi_ws281x>=5.0.0 ; platform_machine=='aarch64'",
"sdbus-networkmanager>=2.0.0 ; platform_machine=='aarch64'",
"semver>=3.0.2",
"sentry-sdk>=1.43.0",
"simpleaudio>=1.0.4",
"tenacity>=8.2.3",
"ubo-gui>=0.13.10",
# Adafruit dependencies
"adafruit-circuitpython-aw9523 >=1.1.7",
"adafruit-circuitpython-neopixel >=6.3.11",
"adafruit-circuitpython-pct2075 >=1.1.21",
"adafruit-circuitpython-rgb-display >=3.11.0",
"adafruit-circuitpython-veml7700 >=1.1.22",
"adafruit-circuitpython-aw9523>=1.1.7",
"adafruit-circuitpython-neopixel>=6.3.11",
"adafruit-circuitpython-pct2075>=1.1.21",
"adafruit-circuitpython-rgb-display>=3.11.0",
"adafruit-circuitpython-veml7700>=1.1.22",
# RPi dependencies
"fasteners >=0.19",
"piper-tts >=1.2.0 ; sys_platform=='linux'",
"rpi-lgpio >=0.6 ; platform_machine=='aarch64'",
"fasteners>=0.19",
"piper-tts>=1.2.0 ; sys_platform=='linux'",
"rpi-lgpio>=0.6 ; platform_machine=='aarch64'",
# gRPC
"betterproto [compiler] >=2.0.0b7",
"gpiozero >=2.0.1 ; platform_machine != 'aarch64'",
"betterproto [compiler]>=2.0.0b7",
"gpiozero>=2.0.1 ; platform_machine != 'aarch64'",
]

[build-system]
Expand All @@ -64,32 +64,29 @@ local_scheme = "setup_scm_schemes:local_scheme"

[tool.hatch.build]
packages = ["ubo_app"]
exclude = ["ubo_app/services/090-web-ui/web-app/node_modules"]

[tool.hatch.build.targets.sdist]
packages = ["ubo_app"]

[tool.uv]
dev-dependencies = [
"grpcio-tools >=1.66.1",
"headless-kivy [test] >=0.12.1",
"ipython >=8.23.0",
"poethepoet >=0.24.4",
"pyfakefs >=5.7.4",
"pyright >=1.1.389",
"pytest >=8.0.0",
"pytest-asyncio >=0.23.5.post1",
"pytest-cov >=4.1.0",
"pytest-mock >=3.14.0",
"pytest-timeout >=2.3.1",
"pytest-xdist >=3.5.0",
"ruff >=0.9.6",
"toml >=0.10.2",
"grpcio-tools>=1.66.1",
"headless-kivy [test]>=0.12.1",
"ipython>=8.23.0",
"poethepoet>=0.24.4",
"pyfakefs>=5.7.4",
"pyright>=1.1.389",
"pytest>=8.0.0",
"pytest-asyncio>=0.23.5.post1",
"pytest-cov>=4.1.0",
"pytest-mock>=3.14.0",
"pytest-timeout>=2.3.1",
"pytest-xdist>=3.5.0",
"ruff>=0.9.6",
"toml>=0.10.2",
]


[tool.uv.sources]
pyfakefs = { git = "https://github.com/pytest-dev/pyfakefs.git" }

[project.scripts]
ubo = "ubo_app.main:main"
ubo-bootstrap = "ubo_app.system.bootstrap:main"
Expand All @@ -105,8 +102,9 @@ typecheck = "pyright -p pyproject.toml ."
test = "pytest --cov=ubo_app"
sanity = ["typecheck", "lint", "test"]
build-docker-images = "sh -c 'docker buildx build . -f scripts/Dockerfile.dev -t ubo-app-dev && docker buildx build . -f scripts/Dockerfile.test -t ubo-app-test'"
build-web-app = "sh -c 'cd ubo_app/services/090-web-ui/web-app/ && npm install --include=dev && npm run compile && npm run build'"

"proto:generate:raw" = "python ubo_app/rpc/generate_proto.py"
"proto:generate:raw" = "python ubo_app/rpc/generator/generate_proto.py"
"proto:generate" = ["proto:generate:raw", "proto:lint"]
"proto:compile:raw" = "sh -c 'mkdir -p ubo_app/rpc/generated && python -m grpc_tools.protoc -I ubo_app/rpc/proto/ --python_betterproto_opt=typing.310 --python_betterproto_out=ubo_app/rpc/generated/ ubo_app/rpc/proto/store/v1/store.proto'"
"proto:compile" = ["proto:compile:raw", "lint:fix"]
Expand Down
4 changes: 4 additions & 0 deletions ubo_app/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,20 @@ def render_on_display(*, regions: list[Region]) -> None:
data_bytes,
)
compressor = zlib.compressobj(wbits=-zlib.MAX_WBITS)
from kivy.metrics import dp

store._dispatch( # noqa: SLF001
[
DisplayRenderEvent(
data=region['data'].tobytes(),
rectangle=rectangle,
density=dp(1),
),
DisplayCompressedRenderEvent(
compressed_data=compressor.compress(region['data'].tobytes())
+ compressor.flush(),
rectangle=rectangle,
density=dp(1),
),
],
)
Expand Down
Loading

0 comments on commit 84e614d

Please sign in to comment.