Publish libkp on PyPI, and move the Home Assistant integration out - #6
Merged
Conversation
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
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.
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 underpython/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.pydereferenced 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.ymlpublishes over Trusted Publishing (OIDC), so no API token lives in this repository. Pushpython-v<version>and it checks the tag againstpyproject.tomland__init__.pybefore building.libkp.testingtests/fake_device.pybecomeslibkp.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
homeassistantjob, which moved with the code.575 passed, 5 skipped, codegen check clean, wheel builds withlibkp/testing.pyin it.