Skip to content
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
1 change: 1 addition & 0 deletions .codespell-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
astroid
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"features": {
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "2.0.18",
"resolved": "ghcr.io/devcontainers-extra/features/pre-commit@sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e",
"integrity": "sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e"
},
"ghcr.io/devcontainers-extra/features/uv:1": {
"version": "1.0.2",
"resolved": "ghcr.io/devcontainers-extra/features/uv@sha256:1ac5b9f17a9e9e745933d0ac2ecf758e06ed3da4423cd22c94cce4d482fd2dd8",
"integrity": "sha256:1ac5b9f17a9e9e745933d0ac2ecf758e06ed3da4423cd22c94cce4d482fd2dd8"
},
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
"version": "0.0.5",
"resolved": "ghcr.io/devcontainers-extra/features/zsh-plugins@sha256:4dcc8e97307345cff26c2b4dfd840c2947b8b5bb20f492a68bdb9fbe9ccb67ba",
"integrity": "sha256:4dcc8e97307345cff26c2b4dfd840c2947b8b5bb20f492a68bdb9fbe9ccb67ba"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.5.9",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a",
"integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "1.3.5",
"resolved": "ghcr.io/devcontainers/features/git@sha256:27905dc196c01f77d6ba8709cb82eeaf330b3b108772e2f02d1cd0d826de1251",
"integrity": "sha256:27905dc196c01f77d6ba8709cb82eeaf330b3b108772e2f02d1cd0d826de1251"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.0",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "1.8.0",
"resolved": "ghcr.io/devcontainers/features/python@sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511",
"integrity": "sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511"
}
}
}
137 changes: 73 additions & 64 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,75 @@
{
"containerEnv": {
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
},
"customizations": {
"codespaces": {
"openFiles": [
"README.md"
]
},
"vscode": {
"extensions": [
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"charliermarsh.ruff",
"GitHub.vscode-github-actions",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"coverage-gutters.customizable.context-menu": true,
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.xmlname": "coverage.xml",
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": [
"--cov-report=xml"
],
"python.testing.pytestEnabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [
".venv/bin/python"
],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"name": "Asynchronous Python API for MelCloud",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/python:1": {
"installTools": false
}
},
"updateContentCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install && poetry run pre-commit install",
"postStartCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install && poetry run pre-commit install"
"name": "${containerWorkspaceFolderBasename}",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.14",
"customizations": {
"codespaces": {
"openFiles": [
"README.md"
]
},
"vscode": {
"extensions": [
"GitHub.copilot",
"GitHub.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"Tyriar.sort-lines",
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"mhutchie.git-graph",
"ms-python.python",
"oderwat.indent-rainbow",
"redhat.vscode-yaml",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"coverage-gutters.customizable.context-menu": true,
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.xmlname": "coverage.xml",
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "ruff",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": [
"--cov-report=xml"
],
"python.testing.pytestEnabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [
".venv/bin/python"
],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-extra/features/uv:1": {},
"ghcr.io/devcontainers-extra/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"installOhMyZsh": true
},
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
"plugins": "git zsh-autosuggestions zsh-syntax-highlighting zsh-completions",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/zsh-users/zsh-completions.git"
},
"ghcr.io/devcontainers/features/python:1": {
"installTools": false
}
},
"postCreateCommand": "uv sync --all-groups && uv tool install prek && pre-commit install"
}
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Build and test
'on':
push:
branches: [ '*' ]
branches: ['*']
pull_request:
branches: [ '*' ]
branches: ['*']
jobs:
build:
runs-on: ubuntu-latest
Expand Down
108 changes: 43 additions & 65 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,140 +17,118 @@ jobs:
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: uv sync
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
run: uv run ruff check --output-format=github .
- name: 🚀 Run ruff formatter
run: poetry run ruff format --check .
run: uv run ruff format --check .

pre-commit-hooks:
name: Pre-commit-hooks
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: uv sync
- name: 🚀 Check Python AST
run: poetry run pre-commit run check-ast --all-files
run: uv run pre-commit run check-ast --all-files
- name: 🚀 Check for case conflicts
run: poetry run pre-commit run check-case-conflict --all-files
run: uv run pre-commit run check-case-conflict --all-files
- name: 🚀 Check docstring is first
run: poetry run pre-commit run check-docstring-first --all-files
run: uv run pre-commit run check-docstring-first --all-files
- name: 🚀 Check that executables have shebangs
run: poetry run pre-commit run check-executables-have-shebangs --all-files
run: uv run pre-commit run check-executables-have-shebangs --all-files
- name: 🚀 Check JSON files
run: poetry run pre-commit run check-json --all-files
run: uv run pre-commit run check-json --all-files
- name: 🚀 Check for merge conflicts
run: poetry run pre-commit run check-merge-conflict --all-files
run: uv run pre-commit run check-merge-conflict --all-files
- name: 🚀 Check for broken symlinks
run: poetry run pre-commit run check-symlinks --all-files
run: uv run pre-commit run check-symlinks --all-files
- name: 🚀 Check TOML files
run: poetry run pre-commit run check-toml --all-files
run: uv run pre-commit run check-toml --all-files
- name: 🚀 Check XML files
run: poetry run pre-commit run check-xml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
run: uv run pre-commit run check-xml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
run: uv run pre-commit run check-yaml --all-files
- name: 🚀 Detect Private Keys
run: poetry run pre-commit run detect-private-key --all-files
run: uv run pre-commit run detect-private-key --all-files
- name: 🚀 Check End of Files
run: poetry run pre-commit run end-of-file-fixer --all-files
run: uv run pre-commit run end-of-file-fixer --all-files
- name: 🚀 Trim Trailing Whitespace
run: poetry run pre-commit run trailing-whitespace --all-files
run: uv run pre-commit run trailing-whitespace --all-files

pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: uv sync
- name: 🚀 Run pylint
run: poetry run pre-commit run pylint --all-files
run: uv run pre-commit run pylint --all-files

yamllint:
name: Yamllint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: uv sync
- name: 🚀 Run yamllint
run: poetry run yamllint .
run: uv run yamllint .

prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: uv sync
- name: 🏗 Set up Node.js
uses: actions/setup-node@v4.0.2
with:
Expand All @@ -159,4 +137,4 @@ jobs:
- name: 🏗 Install NPM dependencies
run: npm install
- name: 🚀 Run prettier
run: poetry run pre-commit run prettier --all-files
run: uv run pre-commit run prettier --all-files
Loading
Loading