Skip to content

Modernize packaging + drop support for 3.7 and 3.8 #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -35,14 +36,14 @@ jobs:

strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -66,12 +67,12 @@ jobs:

strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include README.md LICENSE
recursive-include pyhap/resources *
recursive-include pyhap/resources *
2 changes: 0 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
import sphinx_rtd_theme
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
4 changes: 3 additions & 1 deletion pyhap/accessory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for the Accessory classes."""

import itertools
import logging
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional
Expand Down Expand Up @@ -207,7 +208,8 @@ def xhm_uri(self) -> str:
int(self.driver.state.pincode.replace(b"-", b""), 10) & 0x7FFFFFFF
) # pincode

encoded_payload = base36.dumps(payload).upper() # pylint: disable=possibly-used-before-assignment
# pylint: disable-next=possibly-used-before-assignment
encoded_payload = base36.dumps(payload).upper()
encoded_payload = encoded_payload.rjust(9, "0")

return "X-HM://" + encoded_payload + self.driver.state.setup_id
Expand Down
11 changes: 8 additions & 3 deletions pyhap/accessory_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
terminates the call chain and concludes the publishing process from the Characteristic,
the Characteristic does not block waiting for the actual send to happen.
"""

import asyncio
import base64
from collections import defaultdict
Expand Down Expand Up @@ -212,7 +213,7 @@ def __init__(
advertised_address=None,
interface_choice=None,
async_zeroconf_instance=None,
zeroconf_server=None
zeroconf_server=None,
):
"""
Initialize a new AccessoryDriver object.
Expand Down Expand Up @@ -323,7 +324,7 @@ def start(self):
and os.name != "nt"
):
logger.debug("Setting child watcher")
watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
watcher.attach_loop(self.loop)
asyncio.set_child_watcher(watcher)
else:
Expand Down Expand Up @@ -647,7 +648,11 @@ def persist(self):
mode="w", dir=temp_dir, delete=False
) as file_handle:
tmp_filename = file_handle.name
logger.debug("Created temp persist file '%s' named '%s'", file_handle, tmp_filename)
logger.debug(
"Created temp persist file '%s' named '%s'",
file_handle,
tmp_filename,
)
self.encoder.persist(file_handle, self.state)
if (
os.name == "nt"
Expand Down
Loading
Loading