Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ca87367
Remove alarm module and all associated references
KJonline Apr 25, 2026
cc1f580
Standardize token, config, and internal attribute naming to snake_case
KJonline Apr 25, 2026
77dff3c
Rename deviceList, entityCache, and cache methods to snake_case
KJonline Apr 25, 2026
93b5403
Replace eval-string PRODUCTS/DEVICES with EntityConfig and Device dat…
KJonline Apr 25, 2026
6c9f2da
Replace broad pylint skip-file with targeted per-file disable comments
KJonline Apr 25, 2026
400f3fa
Fix test_hub.py to use renamed update_lock attribute
KJonline Apr 25, 2026
84df099
Rename all action.py and API methods to snake_case
KJonline Apr 26, 2026
d4828d5
Add backwards-compatible camelCase aliases for public API methods
KJonline Apr 26, 2026
fe5c934
Refactor device data handling to use Device dataclass attributes inst…
KJonline Apr 26, 2026
4e509ff
Update addList to handle action entities without calling get_device_data
KJonline Apr 27, 2026
6ed4c63
Add graphify knowledge graph integration and refactor action.py for c…
KJonline Apr 27, 2026
2479ab3
Exclude graphify-out directory from CI pylint and pre-commit checks
KJonline Apr 29, 2026
4ffea56
Refactor session state to use dataclasses and extract retry/epoch hel…
KJonline May 1, 2026
ba063a6
chore: consolidate packaging config into pyproject.toml
KJonline May 2, 2026
b6b5e24
chore: consolidate packaging config into pyproject.toml
KJonline May 2, 2026
587dd4b
Merge branch 'tidy-up-codebase-v2' of https://github.com/Pyhass/Pyhiv…
KJonline May 2, 2026
37fcd81
chore: trim setup.py to unasync cmdclass only
KJonline May 2, 2026
d9d569b
chore: remove setup.cfg and requirements files (consolidated into pyp…
KJonline May 2, 2026
cc35975
chore: remove requirements file references from MANIFEST.in
KJonline May 2, 2026
2bfd36a
chore: replace flake8/isort/black with ruff in pre-commit
KJonline May 2, 2026
f0517f4
ci: update cache keys and install command, replace black/flake8/isort…
KJonline May 2, 2026
7a63bf5
ci: update version bump to target pyproject.toml
KJonline May 2, 2026
9bc8ee0
ci: update version read to target pyproject.toml
KJonline May 2, 2026
1e6f5ac
chore: fix gitignore, add pytest/coverage config, fill out CONTRIBUTING
KJonline May 2, 2026
cc5dd73
chore: replace husky/secretlint with detect-secrets pre-commit hook
KJonline May 2, 2026
9f0954a
chore: enable additional ruff rules (UP, B, PL) and apply auto-fixes
KJonline May 2, 2026
5bdc540
chore: explicitly list packages in setuptools config instead of using…
KJonline May 2, 2026
a10df63
docs: rewrite README with comprehensive usage guide and examples
KJonline May 2, 2026
88754e5
chore: add pyhive_integration package alongside apyhiveapi in setupto…
KJonline May 2, 2026
90f4f17
chore: replace data.json with anonymised fixture and add PII pre-comm…
KJonline May 2, 2026
a8c94e9
chore: rename pyhive_integration package to pyhive in setuptools config
KJonline May 2, 2026
c6955ba
chore: bump version to 2.0.0
KJonline May 4, 2026
6678ffd
chore: add graphify-out/.graphify_ast.json with complete AST analysis
KJonline May 4, 2026
9e0e4c6
Refactor setup
KJonline May 4, 2026
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
155 changes: 27 additions & 128 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'requirements*.txt'
- 'setup.py'
- 'setup.cfg'
- 'pyproject.toml'
- 'MANIFEST.in'
- '.pre-commit-config.yaml'
Expand All @@ -23,9 +21,7 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'requirements*.txt'
- 'setup.py'
- 'setup.cfg'
- 'pyproject.toml'
- 'MANIFEST.in'
- '.pre-commit-config.yaml'
Expand Down Expand Up @@ -62,20 +58,17 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
restore-keys: |
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev python3-dev build-essential
python -m venv venv
. venv/bin/activate
pip install -U "pip<20.3" setuptools
pip install -r requirements.txt -r requirements_test.txt
pip install -U pip setuptools
pip install -e ".[dev]"
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4
Expand Down Expand Up @@ -111,8 +104,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -135,50 +127,6 @@ jobs:
. venv/bin/activate
pre-commit run --hook-stage manual bandit --all-files --show-diff-on-failure

lint-black:
name: Check black
runs-on: ubuntu-latest
needs: prepare-base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v5
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v4
with:
path: venv
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
${{ env.CACHE_VERSION}}-${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run black
run: |
. venv/bin/activate
pre-commit run --hook-stage manual black --all-files --show-diff-on-failure

lint-codespell:
name: Check codespell
runs-on: ubuntu-latest
Expand All @@ -199,8 +147,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -246,8 +193,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -273,8 +219,8 @@ jobs:
. venv/bin/activate
pre-commit run --hook-stage manual check-executables-have-shebangs --all-files

lint-flake8:
name: Check flake8
lint-json:
name: Check JSON
runs-on: ubuntu-latest
needs: prepare-base
steps:
Expand All @@ -293,8 +239,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -312,16 +257,16 @@ jobs:
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register flake8 problem matcher
- name: Register check-json problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
- name: Run flake8
echo "::add-matcher::.github/workflows/matchers/check-json.json"
- name: Run check-json
run: |
. venv/bin/activate
pre-commit run --hook-stage manual flake8 --all-files
pre-commit run --hook-stage manual check-json --all-files

lint-isort:
name: Check isort
lint-pyupgrade:
name: Check pyupgrade
runs-on: ubuntu-latest
needs: prepare-base
steps:
Expand All @@ -340,8 +285,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -359,13 +303,13 @@ jobs:
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run isort
- name: Run pyupgrade
run: |
. venv/bin/activate
pre-commit run --hook-stage manual isort --all-files --show-diff-on-failure
pre-commit run --hook-stage manual pyupgrade --all-files --show-diff-on-failure

lint-json:
name: Check JSON
lint-ruff:
name: Check ruff
runs-on: ubuntu-latest
needs: prepare-base
steps:
Expand All @@ -384,8 +328,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -403,57 +346,14 @@ jobs:
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register check-json problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/check-json.json"
- name: Run check-json
- name: Run ruff
run: |
. venv/bin/activate
pre-commit run --hook-stage manual check-json --all-files

lint-pyupgrade:
name: Check pyupgrade
runs-on: ubuntu-latest
needs: prepare-base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v5
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v4
with:
path: venv
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
${{ env.CACHE_VERSION}}-${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run pyupgrade
pre-commit run ruff --all-files --show-diff-on-failure
- name: Run ruff-format
run: |
. venv/bin/activate
pre-commit run --hook-stage manual pyupgrade --all-files --show-diff-on-failure
pre-commit run ruff-format --all-files --show-diff-on-failure

lint-yaml:
name: Check YAML
Expand All @@ -475,8 +375,7 @@ jobs:
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_test.txt') }}
hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -516,4 +415,4 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
python -m pylint --fail-under=10 `find -regextype egrep -regex '(.*.py)$'`
python -m pylint --fail-under=10 `find -regextype egrep -regex '(.*.py)$' -not -path './graphify-out/*'`
12 changes: 6 additions & 6 deletions .github/workflows/dev-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
echo "PR #$existing already open; skipping version bump."
fi

- name: Bump patch version in setup.py
- name: Bump patch version in pyproject.toml
if: steps.check.outputs.existing == ''
run: |
python - <<'PY'
import re, pathlib
p = pathlib.Path("setup.py")
p = pathlib.Path("pyproject.toml")
s = p.read_text()
m = re.search(r'version="(\d+)\.(\d+)\.(\d+)"', s)
m = re.search(r'^version\s*=\s*"(\d+)\.(\d+)\.(\d+)"', s, re.MULTILINE)
if not m:
raise SystemExit("version not found")
raise SystemExit("version not found in pyproject.toml")
maj, mnr, pat = map(int, m.groups())
new = f'version="{maj}.{mnr}.{pat+1}"'
new = f'version = "{maj}.{mnr}.{pat+1}"'
p.write_text(s[:m.start()] + new + s[m.end():])
print("Bumped to", new)
PY
Expand All @@ -51,7 +51,7 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add setup.py
git add pyproject.toml
if ! git diff --cached --quiet; then
git commit -m "chore: bump version [skip ci]"
git push
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-on-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
with:
fetch-depth: 0

- name: Read version from setup.py
- name: Read version from pyproject.toml
id: version
run: |
v=$(python -c "import re; print(re.search(r'version=\"([^\"]+)\"', open('setup.py').read()).group(1))")
v=$(python -c "import re; m=re.search(r'^version\s*=\s*\"([^\"]+)\"', open('pyproject.toml').read(), re.MULTILINE); print(m.group(1))")
echo "version=$v" >> "$GITHUB_OUTPUT"
echo "tag=v$v" >> "$GITHUB_OUTPUT"

Expand Down
Loading
Loading