Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:

jobs:
claude-review:
if: github.event.pull_request.draft == false
# Fork PRs get no secrets or OIDC token on `pull_request`, so the action
# cannot authenticate there — skip them (use @claude via claude.yml instead).
if: >-
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -26,10 +30,19 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Review this pull request for the pyhive-integration Python library. Check for:
- Correctness: logic errors, incorrect async/await usage, blocking calls in async context
- Type annotations: missing or incorrect types on public methods
- Security: no secrets in code, safe HTTP and Cognito API call patterns
- Style: snake_case naming, no unused imports, ruff/pylint compliance
- Tests: are new features or bug fixes covered by tests?
Post inline comments on specific lines where relevant. Be concise.

Use `gh pr diff` and `gh pr view` to inspect the changes.
Post inline comments on specific lines with
mcp__github_inline_comment__create_inline_comment, then post a short
overall summary with `gh pr comment`. Be concise.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read,Glob,Grep"
3 changes: 3 additions & 0 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Build package
run: python -m build

- name: Verify built distribution is importable
run: python scripts/verify_dist.py dist

- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
python -m pip install build
python -m build

- name: Verify built distribution is importable
run: python scripts/verify_dist.py dist

- name: Upload wheel to GitHub Release
uses: ncipollo/release-action@v1
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'scripts/**'
- 'setup.py'
- 'pyproject.toml'
- 'MANIFEST.in'
- '.github/workflows/tests.yml'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'scripts/**'
- 'setup.py'
- 'pyproject.toml'
- 'MANIFEST.in'
- '.github/workflows/tests.yml'

jobs:
Expand All @@ -43,3 +47,30 @@ jobs:

- name: Run tests
run: pytest tests/ --tb=short --no-cov

packaging:
name: Packaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v7
with:
python-version: "3.x"

# verify_dist.py installs the wheel, which pulls pyquery -> lxml. Match the
# tests job so a Python version without prebuilt lxml wheels can still build.
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libxml2-dev libxslt1-dev python3-dev build-essential
python -m pip install build

- name: Build distributions
run: python -m build

# The test suite runs against src/ via an editable install, so it cannot
# see packaging mistakes. This installs the built wheel in a clean venv
# and imports every module in it.
- name: Verify built distribution is importable
run: python scripts/verify_dist.py dist
10 changes: 5 additions & 5 deletions .secrets.baseline

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
recursive-include pyhiveapi *
recursive-include data *
recursive-include src *.py
recursive-include src/data *.json
include LICENSE README.md
global-exclude .DS_Store
global-exclude *.py[cod]
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: setup test lint sync
.PHONY: setup test lint sync verify-dist

setup:
pip install -e ".[dev]"
Expand All @@ -15,3 +15,10 @@ lint:

sync:
python setup.py build_py

# Build the wheel and prove it is importable in a clean venv. The test suite
# runs against src/, so only this catches packaging regressions.
verify-dist:
rm -rf dist
python -m build
python scripts/verify_dist.py dist
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyhive-integration

![CI](https://github.com/Pyhive/Pyhiveapi/actions/workflows/ci.yml/badge.svg) ![PyPI](https://img.shields.io/pypi/v/pyhive-integration) ![Python](https://img.shields.io/pypi/pyversions/pyhive-integration) ![License](https://img.shields.io/github/license/Pyhive/Pyhiveapi)
![CI](https://github.com/Pyhass/Pyhive/actions/workflows/ci.yml/badge.svg) ![PyPI](https://img.shields.io/pypi/v/pyhive-integration) ![Python](https://img.shields.io/pypi/pyversions/pyhive-integration) ![License](https://img.shields.io/github/license/Pyhass/Pyhive)

A Python library for interfacing with the [Hive](https://www.hivehome.com/) smart home platform. Provides both async (`apyhiveapi`) and sync (`pyhiveapi`) APIs, and is designed primarily for use with [Home Assistant](https://www.home-assistant.io/) — though it works standalone too.

Expand Down Expand Up @@ -175,11 +175,11 @@ python setup.py build_py
## Links

- [PyPI](https://pypi.org/project/pyhive-integration/)
- [Source](https://github.com/Pyhive/Pyhiveapi)
- [Issue Tracker](https://github.com/Pyhive/Pyhiveapi/issues)
- [Source](https://github.com/Pyhass/Pyhive)
- [Issue Tracker](https://github.com/Pyhass/Pyhive/issues)

---

## License

MIT License — see [LICENSE](LICENSE) for details.
MIT License — see [LICENSE](https://github.com/Pyhass/Pyhive/blob/master/LICENSE) for details.
24 changes: 20 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ dependencies = [
]

[project.urls]
Homepage = "https://github.com/Pyhive/pyhiveapi"
Source = "https://github.com/Pyhive/Pyhiveapi"
"Issue Tracker" = "https://github.com/Pyhive/Pyhiveapi/issues"
Homepage = "https://github.com/Pyhass/Pyhive"
Source = "https://github.com/Pyhass/Pyhive"
"Issue Tracker" = "https://github.com/Pyhass/Pyhive/issues"

[project.optional-dependencies]
dev = [
Expand All @@ -53,7 +53,23 @@ dev = [
]

[tool.setuptools]
packages = ["apyhiveapi", "apyhiveapi.api", "apyhiveapi.helper", "pyhive", "pyhive.api", "pyhive.helper"]
# Keep this list in sync with the package directories under src/. It is explicit
# rather than auto-discovered because package-dir maps two distribution names
# (apyhiveapi, pyhive) onto the same source tree, which find: cannot express.
# The sync flavour (pyhiveapi) is generated at build time by the unasync
# build_py cmdclass in setup.py and so is not listed here.
packages = [
"apyhiveapi",
"apyhiveapi.api",
"apyhiveapi.devices",
"apyhiveapi.helper",
"apyhiveapi.session",
"pyhive",
"pyhive.api",
"pyhive.devices",
"pyhive.helper",
"pyhive.session",
]

[tool.setuptools.package-dir]
apyhiveapi = "src"
Expand Down
Loading
Loading