Skip to content

Publish libkp on PyPI, and move the Home Assistant integration out - #6

Merged
gotwalt merged 1 commit into
mainfrom
feat/pypi-and-hacs
Aug 27, 2026
Merged

Publish libkp on PyPI, and move the Home Assistant integration out#6
gotwalt merged 1 commit into
mainfrom
feat/pypi-and-hacs

Conversation

@gotwalt

@gotwalt gotwalt commented Aug 27, 2026

Copy link
Copy Markdown
Owner

The Home Assistant integration is going to HACS, which resolves a component by walking the repository root for custom_components/<domain> — it never saw one nested under python/examples. So the integration moves to its own repository, gotwalt/kemper-homeassistant, and the vendoring that supported it here goes away.

libkp on PyPI

The integration used to reach the library through a symlink that build.py dereferenced into a vendored copy. Now it names a release in its manifest ("requirements": ["libkp==0.1.0"]) and Home Assistant installs it — no copy to keep in sync.

.github/workflows/publish-python.yml publishes over Trusted Publishing (OIDC), so no API token lives in this repository. Push python-v<version> and it checks the tag against pyproject.toml and __init__.py before building.

libkp.testing

tests/fake_device.py becomes libkp.testing, shipped in the wheel. It is what let the integration's tests hold a real session over a loopback socket with nothing below the config entry mocked, and from another repository it can only do that from inside the package. libkp's own async tests are unchanged apart from the import.

Also

  • Root README: Python installs from PyPI; a pointer to the integration's repository.
  • CI drops the homeassistant job, which moved with the code.

575 passed, 5 skipped, codegen check clean, wheel builds with libkp/testing.py in it.

The integration vendored the library through a symlink the bundler had to
dereference. Publishing libkp instead makes it an ordinary requirement: the
integration names a release in its manifest and Home Assistant installs it,
so there is no copy of the library to keep in sync and nothing to unpick at
build time. It moves to gotwalt/kemper-homeassistant, which is what HACS can
take — HACS resolves a component by walking the repository root for
custom_components/<domain>, and never saw it nested under python/examples.

The fake Profiler moves with it, the other way: tests/fake_device.py becomes
libkp.testing, shipped in the wheel. It is what let the integration's tests
hold a real session over a loopback socket with nothing below the config entry
mocked, and it can only go on doing that from inside the package.

Releases are tag-driven and publish over Trusted Publishing, so no API token
lives in this repository: push python-v<version> and the workflow checks the
tag against pyproject.toml and __init__.py before it builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQn7c64v3STBbMhyRq13eG
@gotwalt
gotwalt merged commit e5daced into main Aug 27, 2026
5 checks passed
@gotwalt
gotwalt deleted the feat/pypi-and-hacs branch August 27, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant