From 005fa9259d00ceea7cf989a5a784713fb0759877 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Tue, 1 Dec 2026 09:29:36 +0000 Subject: [PATCH 1/3] Update Corio logging and test configuration --- haco/obs.py | 8 ++------ haco/sb3.py | 4 +++- pyproject.toml | 32 ++++++++++++++++++++++++-------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/haco/obs.py b/haco/obs.py index 121b056..3dc4036 100644 --- a/haco/obs.py +++ b/haco/obs.py @@ -3,14 +3,10 @@ Observability and logging setup for the haco library. """ -from corio import logs, debug, Constants +from corio import debug, logs from haco.paths import paths debug.trace() -logger = logs.get_logger( - name=paths.name, - stream=Constants.DEVELOPMENT, - version=paths.metadata.version, -) +logger = logs.from_paths(paths) diff --git a/haco/sb3.py b/haco/sb3.py index 3ca3d93..ba65113 100644 --- a/haco/sb3.py +++ b/haco/sb3.py @@ -1,6 +1,8 @@ import asyncio import logging +from logfire import LogfireLoggingHandler + from haco.button import Button from haco.client import ClientHaco from haco.climate import Climate @@ -9,7 +11,7 @@ from haco.obs import logger from haco.select import Select from haco.switch import Switch -handler = logger.LogfireLoggingHandler() +handler = LogfireLoggingHandler(logfire_instance=logger) logging.basicConfig(handlers=[handler], level=logging.DEBUG) async def main(): diff --git a/pyproject.toml b/pyproject.toml index 450ff74..a887912 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,13 +19,19 @@ editables = ["corio"] [tool.corio.metadata.setup] +[tool.corio.test-envs] +dev = ["dev"] + +[tool.setuptools] +include-package-data = false + [tool.setuptools.packages.find] where = ["."] include = ["haco*"] namespaces = false [tool.setuptools.package-data] -haco = ["pyproject.package.toml", "assets/**"] +haco = ["pyproject.package.toml", "**/assets/**"] [tool.uv.sources.corio] path = "../corio" @@ -36,13 +42,23 @@ editable_mode = "compat" [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] -env_list = ["haco"] +env_list = ["prod"] -[tool.tox.env.haco] +[tool.tox.env.dev] description = "Run haco tests." -deps = ["corio[test]~=2.17.8"] +deps = ["-e ../corio[api,caching,debug,mqtt,sets,test,yaml]", "psutil"] commands = [["python", "-m", "pytest", "-q", "{posargs:haco/tests}"]] install_command = ["uv", "pip", "install", "--refresh-package", "corio", "{opts}", "{packages}"] +skip_install = true + +[tool.tox.env.prod] +description = "Run haco tests." +deps = ["corio[test]~=2.21.5"] +commands = [["python", "-m", "pytest", "-q", "{posargs:haco/tests}"]] +install_command = ["uv", "pip", "install", "--refresh-package", "corio", "{opts}", "{packages}"] + +[tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" [project] name = "haco" @@ -51,15 +67,15 @@ description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = ["corio[api,caching,debug,logging,mqtt,sets,yaml]~=2.17.8", "psutil"] +dependencies = ["corio[api,caching,debug,mqtt,sets,yaml]~=2.21.5", "psutil"] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -dev = ["corio[infra]~=2.17.8"] -test = ["corio[test]~=2.17.8"] +dev = ["corio[infra]~=2.21.5"] +test = ["corio[test]~=2.21.5"] [project.urls] Homepage = "https://github.com/fmtr/haco" @@ -67,4 +83,4 @@ Homepage = "https://github.com/fmtr/haco" [project.scripts] [dependency-groups] -dev = ["corio[infra]~=2.17.8"] +dev = ["corio[infra]~=2.21.5"] From fbdc97a0f91e90bb34259d27ae6619fa5c44d260 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Tue, 1 Dec 2026 09:30:52 +0000 Subject: [PATCH 2/3] Release version 0.4.7-alpha.0 --- pyproject.toml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a887912..db86c31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.6" +version = "0.4.7-alpha.0" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -33,6 +33,9 @@ namespaces = false [tool.setuptools.package-data] haco = ["pyproject.package.toml", "**/assets/**"] +[tool.uv] +prerelease = "if-necessary" + [tool.uv.sources.corio] path = "../corio" editable = true @@ -40,6 +43,9 @@ editable = true [tool.uv.config-settings-package.corio] editable_mode = "compat" +[tool.uv.prerelease-package] +corio = "if-necessary" + [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] env_list = ["prod"] @@ -53,7 +59,7 @@ skip_install = true [tool.tox.env.prod] description = "Run haco tests." -deps = ["corio[test]~=2.21.5"] +deps = ["corio[test]~=2.21.6"] commands = [["python", "-m", "pytest", "-q", "{posargs:haco/tests}"]] install_command = ["uv", "pip", "install", "--refresh-package", "corio", "{opts}", "{packages}"] @@ -62,20 +68,20 @@ asyncio_default_fixture_loop_scope = "function" [project] name = "haco" -version = "0.4.6" +version = "0.4.7-alpha.0" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0" keywords = ["homeassistant", "controls", "python", "tasmota"] -dependencies = ["corio[api,caching,debug,mqtt,sets,yaml]~=2.21.5", "psutil"] +dependencies = ["corio[api,caching,debug,mqtt,sets,yaml]~=2.21.6", "psutil"] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -dev = ["corio[infra]~=2.21.5"] -test = ["corio[test]~=2.21.5"] +dev = ["corio[infra]~=2.21.6"] +test = ["corio[test]~=2.21.6"] [project.urls] Homepage = "https://github.com/fmtr/haco" @@ -83,4 +89,4 @@ Homepage = "https://github.com/fmtr/haco" [project.scripts] [dependency-groups] -dev = ["corio[infra]~=2.21.5"] +dev = ["corio[infra]~=2.21.6"] From 6aa0a6b41f04d2eeaa679851b9f2fb5f08507c1b Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Tue, 1 Dec 2026 09:39:48 +0000 Subject: [PATCH 3/3] Release version 0.4.7 --- CHANGELOG.md | 2 +- docs/changelog/0.4.7.md | 1 + pyproject.toml | 10 ++-------- 3 files changed, 4 insertions(+), 9 deletions(-) create mode 100644 docs/changelog/0.4.7.md diff --git a/CHANGELOG.md b/CHANGELOG.md index f23c2e4..612588c 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.4.6.md \ No newline at end of file +docs/changelog/0.4.7.md \ No newline at end of file diff --git a/docs/changelog/0.4.7.md b/docs/changelog/0.4.7.md new file mode 100644 index 0000000..ef5baae --- /dev/null +++ b/docs/changelog/0.4.7.md @@ -0,0 +1 @@ +- Logs now use the package name and version and respect the configured development or production environment. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index db86c31..8e8059d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=82", "wheel"] build-backend = "setuptools.build_meta" [tool.corio.metadata] -version = "0.4.7-alpha.0" +version = "0.4.7" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -33,9 +33,6 @@ namespaces = false [tool.setuptools.package-data] haco = ["pyproject.package.toml", "**/assets/**"] -[tool.uv] -prerelease = "if-necessary" - [tool.uv.sources.corio] path = "../corio" editable = true @@ -43,9 +40,6 @@ editable = true [tool.uv.config-settings-package.corio] editable_mode = "compat" -[tool.uv.prerelease-package] -corio = "if-necessary" - [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] env_list = ["prod"] @@ -68,7 +62,7 @@ asyncio_default_fixture_loop_scope = "function" [project] name = "haco" -version = "0.4.7-alpha.0" +version = "0.4.7" description = "Home Assistant Control Objects" readme = "README.md" license = "Apache-2.0"