diff --git a/CHANGELOG.md b/CHANGELOG.md index 612588c..f23c2e4 120000 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -docs/changelog/0.4.7.md \ No newline at end of file +docs/changelog/0.4.6.md \ No newline at end of file diff --git a/docs/changelog/0.4.7.md b/docs/changelog/0.4.7.md deleted file mode 100644 index ef5baae..0000000 --- a/docs/changelog/0.4.7.md +++ /dev/null @@ -1 +0,0 @@ -- 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/haco/obs.py b/haco/obs.py index 3dc4036..121b056 100644 --- a/haco/obs.py +++ b/haco/obs.py @@ -3,10 +3,14 @@ Observability and logging setup for the haco library. """ -from corio import debug, logs +from corio import logs, debug, Constants from haco.paths import paths debug.trace() -logger = logs.from_paths(paths) +logger = logs.get_logger( + name=paths.name, + stream=Constants.DEVELOPMENT, + version=paths.metadata.version, +) diff --git a/haco/sb3.py b/haco/sb3.py index ba65113..3ca3d93 100644 --- a/haco/sb3.py +++ b/haco/sb3.py @@ -1,8 +1,6 @@ import asyncio import logging -from logfire import LogfireLoggingHandler - from haco.button import Button from haco.client import ClientHaco from haco.climate import Climate @@ -11,7 +9,7 @@ from haco.obs import logger from haco.select import Select from haco.switch import Switch -handler = LogfireLoggingHandler(logfire_instance=logger) +handler = logger.LogfireLoggingHandler() logging.basicConfig(handlers=[handler], level=logging.DEBUG) async def main(): diff --git a/pyproject.toml b/pyproject.toml index 8e8059d..450ff74 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" +version = "0.4.6" port = 6 base = "python" description = "Home Assistant Control Objects" @@ -19,19 +19,13 @@ 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" @@ -42,40 +36,30 @@ editable_mode = "compat" [tool.tox] requires = ["tox>=4.22", "tox-uv>=1"] -env_list = ["prod"] +env_list = ["haco"] -[tool.tox.env.dev] +[tool.tox.env.haco] description = "Run haco tests." -deps = ["-e ../corio[api,caching,debug,mqtt,sets,test,yaml]", "psutil"] +deps = ["corio[test]~=2.17.8"] 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.6"] -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" -version = "0.4.7" +version = "0.4.6" 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.6", "psutil"] +dependencies = ["corio[api,caching,debug,logging,mqtt,sets,yaml]~=2.17.8", "psutil"] [[project.authors]] name = "Frontmatter AI" email = "innovative.fowler@mask.pro.fmtr.dev" [project.optional-dependencies] -dev = ["corio[infra]~=2.21.6"] -test = ["corio[test]~=2.21.6"] +dev = ["corio[infra]~=2.17.8"] +test = ["corio[test]~=2.17.8"] [project.urls] Homepage = "https://github.com/fmtr/haco" @@ -83,4 +67,4 @@ Homepage = "https://github.com/fmtr/haco" [project.scripts] [dependency-groups] -dev = ["corio[infra]~=2.21.6"] +dev = ["corio[infra]~=2.17.8"]