Merged
Conversation
aioredis 1.3.1 was abandoned in 2022. Replace it with redis.asyncio,
the async interface bundled in redis-py>=4.2.0 (which absorbed aioredis).
pubsub.py:
- Redis() constructor is now synchronous (no await)
- Subscriptions use redis.pubsub() objects with get_message()
instead of wait_message()/get(); read() polls with timeout=0.1s
- disconnect() awaits aclose() on pubsub objects and connections
storage.py:
- Redis() constructor is now synchronous (no await)
- zrange() and zadd() replace raw execute() calls
- zadd() uses {member: score} mapping as required by redis-py 4.x
- disconnect() awaits aclose()
setup.py / requirements.txt:
- Replace aioredis==1.3.1 + hiredis==1.1.0 with redis[hiredis]>=4.2.0
Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids a hiredis compilation failure on Python 3.8 (no pre-built wheel) from blocking the redis installation. With separate entries, redis is installed successfully even if hiredis fails to build.
77b3f58 to
84efb23
Compare
Python 3.14 / APScheduler 3.10+ incompatibilities fixed: home/event/__init__.py: - TypeVar() first argument must be a string; add "Event" as name (Python 3.14 enforces this; 3.8 silently accepted a type) home/scheduler/trigger/protocol/mean.py: - APScheduler 3.10+ start() calls asyncio.get_running_loop() instead of get_event_loop(), so it must be called inside a running event loop - Python 3.14 removed implicit event loop creation from get_event_loop() - Update GreaterThan/LesserThan/InBetween doctests to use asyncio.run() and drop asyncio.get_event_loop().stop() in favour of a plain return requirements.txt / setup.py: - Bump APScheduler from ==3.9.0 to >=3.10.0 (drops pkg_resources usage) - Unpin tzlocal and pytz (pinned versions conflict with APScheduler 3.10+) - Update Python classifier to 3.14 .github/workflows/test.yml: - Switch CI to Python 3.14 (pre-built hiredis wheels available) - Replace deprecated "python setup.py install" with "pip install ." - Add -t . to unittest discover to fix home/tests/redis/ shadowing the installed redis package on sys.path Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migrate packaging metadata to pyproject.toml using setuptools as the build backend. The license classifier is dropped in favour of the SPDX license expression field (PEP 639).
Move flake8 config from .flake8 into pyproject.toml
Add flake8-pyproject plugin so flake8 reads [tool.flake8] from pyproject.toml,
then delete the separate .flake8 file.
Remove redundant quotes from type annotations
from __future__ import annotations makes all annotations lazy strings,
so explicit quotes like "home.Event" are unnecessary.
Fix mypy errors instead of suppressing them globally
Replace Event TypeVar with a proper base class to eliminate arg-type/return-value false positives
The previous Event = TypeVar("Event", int, float, str, Enum, ...) generated
one mypy error per constraint (~80 false positives) at every call site.
Replace it with class Event(pass) in home/event/base.py, make Enum and Int
inherit from it, and remove the now-unnecessary disable_error_code suppression.
Also add a targeted # type: ignore[arg-type] in mean.py where Mixin cannot
be expressed as an Intersection of Trigger and Mixin (Python limitation).
Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pre-commit / CI: - Add local behave hook (language: python, all project deps listed) - Add behave step to GitHub Actions workflow Bug fixes in sound player state machine: - fade_in/callable.Forced: was calling compute_new_state(state, "base", ...) but "base" is not a registered output state for fade_in, causing a silent KeyError and leaving the state in fade_in instead of transitioning to forced_off. Fix: use get_new_state(state, "forced_off") for forced.Off. - sound_player.feature: rows @1.3 and @1.45 expected off after sleepiness.Awake from an off-with-elapsed-On setup, but the auto-inject (elapsed.Event.Off injected on fade_in→off) means the off state always has elapsed=Off after a fade-in cycle, so sleepiness.Awake correctly transitions to fade_in. Update expected state to fade_in. Fix scheduler trigger type check - Fix scheduler trigger type comparison: change `type` from @Property to a class variable in Trigger, state.Trigger, and protocol.Trigger so that class-level comparisons (e.g. Trigger.type == "APPLIANCE STATE") work correctly; this fixes 5 failing unit tests where _schedule_by_trigger_fork was never called Improve documentation: replace sphinx-gherkindoc, add docs target, fix English - Replace broken sphinx-gherkindoc (incompatible with Sphinx 9) with a lightweight custom script docs/gherkindoc.py that converts .feature files to RST code-block pages using only the Python standard library - Update docs/Makefile to use the new script via the PYTHON variable - Fix numerous English issues across all RST documentation files and README: Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add a docs job to test.yml: installs .[doc] extras, runs make -C docs html, and uploads the built HTML as a GitHub Actions artifact - Add publish.yml: triggers on GitHub release (published event), builds a source distribution and wheel with python -m build, then publishes to PyPI using pypa/gh-action-pypi-publish with OIDC trusted publishing (no API token secret required; configure the pypi environment in repository settings) Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
de9a663 to
967b0fd
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.