Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop support for python 3.9 and 3.10 #2

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Poetry
uses: snok/install-poetry@v1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.5.0

- chore: drop support for python 3.9 and 3.10

## Version 0.4.2

- chore: migrate from poetry groups to poetry extras
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ This project demonstrates the use of the Kivy framework to create a headless ren

## ⚡️ Requirements

- Raspberry Pi 4
- Raspberry Pi 4 or 5
- SPI Display (tested with ST7789 module)
- SDL2 with `kmsdrm` backend

You need to compile and install SDL2 from source with `kmsdrm` backend. Please follow the instructions provided [here](https://kivy.org/doc/stable/installation/installation-rpi.html#raspberry-pi-4-headless-installation-on-raspbian-buster)

## 📦 Installation

Expand Down
5 changes: 2 additions & 3 deletions headless_kivy_pi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
Fbo,
Rectangle,
)
from logger import add_file_handler, add_stdout_handler, logger
from typing_extensions import Any, NotRequired, TypedDict

from .logger import add_file_handler, add_stdout_handler, logger

if TYPE_CHECKING:
from kivy.graphics.texture import Texture
from numpy._typing import NDArray
Expand Down Expand Up @@ -404,7 +403,7 @@ def transfer_to_display(
if IS_RPI:
HeadlessWidget._display._block(
0,
0, # noqa: SLF001
0,
HeadlessWidget.width - 1,
HeadlessWidget.height - 1,
data_bytes,
Expand Down
13 changes: 8 additions & 5 deletions headless_kivy_pi/logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: D100, D101, D102, D103, D104, D107
import logging
import sys

Expand All @@ -6,26 +7,28 @@
logger.propagate = False


def add_stdout_handler():
def add_stdout_handler() -> None:
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setLevel(logging.DEBUG)
stdout_handler.setFormatter(
logging.Formatter(
'%(created)f [%(levelname)s] %(message)s', '%Y-%m-%d %H:%M:%S',
'%(created)f [%(levelname)s] %(message)s',
'%Y-%m-%d %H:%M:%S',
),
)
logger.addHandler(stdout_handler)


def add_file_handler():
def add_file_handler() -> None:
file_handler = logging.FileHandler('headless-kivy-pi.log')
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(
logging.Formatter(
'%(created)f [%(levelname)s] %(message)s', '%Y-%m-%d %H:%M:%S',
'%(created)f [%(levelname)s] %(message)s',
'%Y-%m-%d %H:%M:%S',
),
)
logger.addHandler(file_handler)


__all__ = ('logger', 'add_stdout_handler')
__all__ = ('logger', 'add_stdout_handler', 'add_file_handler')
101 changes: 70 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "headless-kivy-pi"
version = "0.4.2"
version = "0.5.0"
description = "Headless renderer for Kivy framework on Raspberry Pi"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -19,24 +19,27 @@ priority = "primary"


[tool.poetry.dependencies]
python = "^3.9"
python = "^3.11"
numpy = "^1.24.2"
kivy = "^2.2.1"
typing-extensions = "^4.8.0"

adafruit-circuitpython-rgb-display = "^3.11.0"
adafruit-circuitpython-aw9523 = "^1.1.7"
adafruit-circuitpython-rgb-display = { version = "^3.11.0", markers = "platform_machine == 'aarch64'", source = 'piwheels' }
adafruit-circuitpython-aw9523 = { version = "^1.1.7", markers = "platform_machine == 'aarch64'", source = 'piwheels' }

screeninfo = { version = "^0.8.1", markers = "platform_machine != 'aarch64'", source = 'PyPI', optional = true }

[tool.poetry.extras]
dev = ['screeninfo']
[tool.poetry.group.dev.dependencies]
poethepoet = { version = "^0.24.2", markers = "platform_machine != 'aarch64'", source = 'PyPI' }
screeninfo = { version = "^0.8.1", markers = "platform_machine != 'aarch64'", source = 'PyPI' }


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poe.tasks]
lint = "pyright -p pyproject.toml ."

[tool.ruff]
select = ['ALL']
ignore = []
Expand Down