Skip to content

Commit

Permalink
Merge branch 'main' into aiohttp_3102
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Aug 8, 2024
2 parents a5f6d5a + 5b46235 commit 8689410
Show file tree
Hide file tree
Showing 62 changed files with 1,352 additions and 290 deletions.
20 changes: 14 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"containerEnv": {
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
},
"remoteEnv": {
"PATH": "${containerEnv:VIRTUAL_ENV}/bin:${containerEnv:PATH}"
},
"appPort": ["9123:8123", "7357:4357"],
"postCreateCommand": "bash devcontainer_bootstrap",
"postCreateCommand": "bash devcontainer_setup",
"postStartCommand": "bash devcontainer_bootstrap",
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
"customizations": {
"vscode": {
Expand All @@ -19,17 +23,21 @@
"GitHub.vscode-pull-request-github"
],
"settings": {
"python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python",
"python.pythonPath": "/home/vscode/.local/ha-venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.testing.pytestArgs": ["--no-cov"],
"pylint.importStrategy": "fromEnvironment",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"python.pythonPath": "/usr/local/bin/python3",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
requirements: ${{ steps.requirements.outputs.changed }}
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].7
with:
fetch-depth: 0

Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].7
with:
fetch-depth: 0

Expand All @@ -106,7 +106,7 @@ jobs:
- name: Build wheels
if: needs.init.outputs.requirements == 'true'
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: cp312
tag: musllinux_1_2
Expand All @@ -125,13 +125,13 @@ jobs:

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.publish == 'true'
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Install Cosign
if: needs.init.outputs.publish == 'true'
uses: sigstore/cosign-installer@v3.5.0
uses: sigstore/cosign-installer@v3.6.0
with:
cosign-release: "v2.2.3"

Expand All @@ -149,7 +149,7 @@ jobs:
- name: Login to GitHub Container Registry
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
steps:
- name: Checkout the repository
if: needs.init.outputs.publish == 'true'
uses: actions/[email protected].4
uses: actions/[email protected].7

- name: Initialize git
if: needs.init.outputs.publish == 'true'
Expand All @@ -203,7 +203,7 @@ jobs:
timeout-minutes: 60
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].7

- name: Build the Supervisor
if: needs.init.outputs.publish != 'true'
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
name: Prepare Python dependencies
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python
id: python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
Expand Down Expand Up @@ -67,9 +67,9 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -110,9 +110,9 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Register hadolint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/hadolint.json"
Expand All @@ -168,9 +168,9 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -212,9 +212,9 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -256,9 +256,9 @@ jobs:
needs: prepare
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -288,14 +288,14 @@ jobs:
name: Run tests Python ${{ needs.prepare.outputs.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Install Cosign
uses: sigstore/cosign-installer@v3.5.0
uses: sigstore/cosign-installer@v3.6.0
with:
cosign-release: "v2.2.3"
- name: Restore Python virtual environment
Expand Down Expand Up @@ -335,7 +335,7 @@ jobs:
-o console_output_style=count \
tests
- name: Upload coverage artifact
uses: actions/[email protected].3
uses: actions/[email protected].6
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
Expand All @@ -346,9 +346,9 @@ jobs:
needs: ["pytest", "prepare"]
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand All @@ -365,12 +365,12 @@ jobs:
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Download all coverage artifacts
uses: actions/[email protected].7
uses: actions/[email protected].8
- name: Combine coverage results
run: |
. venv/bin/activate
coverage combine coverage*/.coverage*
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.5.0
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Release Drafter
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].7
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sentry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].7
- name: Sentry Release
uses: getsentry/[email protected]
env:
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ FROM ${BUILD_FROM}
ENV \
S6_SERVICES_GRACETIME=10000 \
SUPERVISOR_API=http://localhost \
CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1
CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 \
UV_SYSTEM_PYTHON=true

ARG \
COSIGN_VERSION \
Expand All @@ -26,14 +27,17 @@ RUN \
yaml \
\
&& curl -Lso /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/cosign
&& chmod a+x /usr/bin/cosign \
&& pip3 install uv==0.2.21

# Install requirements
COPY requirements.txt .
RUN \
export MAKEFLAGS="-j$(nproc)" \
&& pip3 install --only-binary=:all: \
-r ./requirements.txt \
if [ "${BUILD_ARCH}" = "i386" ]; then \
linux32 uv pip install --no-build -r requirements.txt; \
else \
uv pip install --no-build -r requirements.txt; \
fi \
&& rm -f requirements.txt

# Install Home Assistant Supervisor
Expand Down
10 changes: 5 additions & 5 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
image: ghcr.io/home-assistant/{arch}-hassio-supervisor
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.12-alpine3.19
armhf: ghcr.io/home-assistant/armhf-base-python:3.12-alpine3.19
armv7: ghcr.io/home-assistant/armv7-base-python:3.12-alpine3.19
amd64: ghcr.io/home-assistant/amd64-base-python:3.12-alpine3.19
i386: ghcr.io/home-assistant/i386-base-python:3.12-alpine3.19
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.12-alpine3.20
armhf: ghcr.io/home-assistant/armhf-base-python:3.12-alpine3.20
armv7: ghcr.io/home-assistant/armv7-base-python:3.12-alpine3.20
amd64: ghcr.io/home-assistant/amd64-base-python:3.12-alpine3.20
i386: ghcr.io/home-assistant/i386-base-python:3.12-alpine3.20
codenotary:
signer: [email protected]
base_image: [email protected]
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ include-package-data = true
include = ["supervisor*"]

[tool.pylint.MAIN]
py-version = "3.11"
py-version = "3.12"
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
jobs = 2
Expand Down Expand Up @@ -234,6 +234,7 @@ select = [
"B014", # Exception handler with duplicate exception
"B023", # Function definition does not bind loop variable {name}
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # Use raise from to specify exception cause
"C", # complexity
"COM818", # Trailing comma on bare tuple prohibited
"D", # docstrings
Expand All @@ -247,7 +248,6 @@ select = [
"N804", # First argument of a class method should be named cls
"N805", # First argument of a method should be named self
"N815", # Variable {name} in class scope should not be mixedCase
"PGH001", # No builtin eval() allowed
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"PLC", # pylint
Expand Down Expand Up @@ -286,7 +286,6 @@ select = [
"T20", # flake8-print
"TID251", # Banned imports
"TRY004", # Prefer TypeError exception for invalid type
"TRY200", # Use raise from to specify exception cause
"TRY302", # Remove exception handler; error is immediately re-raised
"UP", # pyupgrade
"W", # pycodestyle
Expand Down
29 changes: 15 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
aiodns==3.2.0
aiohttp==3.10.2
atomicwrites-homeassistant==1.4.1
attrs==23.2.0
awesomeversion==24.2.0
attrs==24.2.0
awesomeversion==24.6.0
brotli==1.1.0
ciso8601==2.3.1
colorlog==6.8.2
cpe==1.2.1
cryptography==42.0.5
debugpy==1.8.1
cryptography==43.0.0
debugpy==1.8.5
deepmerge==1.1.1
dirhash==0.4.0
docker==7.0.0
dirhash==0.5.0
docker==7.1.0
faust-cchardet==2.1.19
gitpython==3.1.43
jinja2==3.1.3
orjson==3.10.1
jinja2==3.1.4
orjson==3.9.15
pulsectl==24.4.0
pyudev==0.24.1
pyudev==0.24.3
PyYAML==6.0.1
requests==2.32.3
securetar==2024.2.1
sentry-sdk==1.45.0
setuptools==69.5.1
voluptuous==0.14.2
dbus-fast==2.21.1
typing_extensions==4.11.0
sentry-sdk==2.10.0
setuptools==72.1.0
voluptuous==0.15.2
dbus-fast==2.22.1
typing_extensions==4.12.2
zlib-fast==0.2.0
Loading

0 comments on commit 8689410

Please sign in to comment.