Skip to content

Fix packaging missing subpackages - #156

Merged
KJonline merged 4 commits into
devfrom
fix-packaging-missing-subpackages
Sep 26, 2026
Merged

KJonline merged 4 commits into
devfrom
fix-packaging-missing-subpackages

Conversation

@KJonline

Copy link
Copy Markdown
Contributor

No description provided.

KJonline and others added 2 commits September 26, 2026 15:20
The 2.0 refactor moved the implementation into src/devices/ and
src/session/, but [tool.setuptools] packages still described the 1.x
flat layout, so setuptools never copied either directory into the
build. The published 2.0.0b1 wheel and sdist therefore contain only
api/, helper/, data/, hive.py and the flat deprecation shims — and
every one of those entry points imports from the two missing
subpackages:

    apyhiveapi/__init__.py:29  from .hive import Hive
    apyhiveapi/hive.py:8       from .devices.action import HiveAction
    ModuleNotFoundError: No module named 'apyhiveapi.devices'

All three flavours (apyhiveapi, pyhive, pyhiveapi) fail at import, so
2.0.0b1 is unusable: it pip-installs cleanly and then breaks Home
Assistant at integration setup.

Add the four missing package names, and note in a comment why the list
is explicit rather than find: (package-dir maps two distribution names
onto one source tree) and why the sync flavour is absent from it (it is
generated by the unasync build_py cmdclass).

MANIFEST.in was stale for the same reason: it referenced a top-level
pyhiveapi/ and data/ that have not existed since the move to src/,
which is why SOURCES.txt listed no devices/ or session/ entries.

The test suite could not catch this — it runs against src/ via an
editable install and never touches the built artifact. Add
scripts/verify_dist.py, which installs the wheel into a throwaway venv
and imports every module in every flavour, and wire it into the tests
workflow and both publish workflows so a build like this cannot reach
PyPI again. Verified: it fails on the published 2.0.0b1 wheel and
passes on this build (132 modules, 3 flavours).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
verify_dist.py installs the built wheel, which resolves pyquery -> lxml.
The packaging job runs on "3.x" (latest stable), which is exactly where a
prebuilt lxml wheel may not yet exist, so install the same headers the
tests job does rather than depending on wheel availability.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (b83f017) to head (b1cd3a8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #156   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files          30       30           
  Lines        2571     2571           
  Branches      297      297           
=======================================
  Hits         2570     2570           
  Partials        1        1           
Flag Coverage Δ
unittests 99.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

KJonline and others added 2 commits September 26, 2026 17:59
Update all GitHub repository references from github.com/Pyhive/Pyhiveapi to github.com/Pyhass/Pyhive in pyproject.toml, README.md badges/links, and LICENSE link. Also skip Claude code review workflow for fork PRs since they lack secrets/OIDC tokens for authentication, and enhance the review prompt to use gh CLI commands and MCP inline comment tool for more targeted feedback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KJonline
KJonline merged commit 29d51cf into dev Sep 26, 2026
11 checks passed
@KJonline
KJonline deleted the fix-packaging-missing-subpackages branch September 26, 2026 19:08
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