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
26 changes: 7 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"containerEnv": {
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
},
"customizations": {
"codespaces": {
"openFiles": [
Expand All @@ -13,53 +10,44 @@
"vscode": {
"extensions": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"esbenp.prettier-vscode",
"GitHub.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
"redhat.vscode-yaml",
"ryanluker.vscode-ecoverage-gutters",
"visualstudioexptteam.vscodeintellicode"
"tamasfe.even-better-toml"
],
"settings": {
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true,
"files.trimTrailingWhitespace": true
}
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"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}/pyhilo"],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "ruff",
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": ["--cov-report=xml"],
"python.testing.pytestEnabled": true,
"python.testing.enabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [".venv/bin/python"],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"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
}
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {}
},
"image": "mcr.microsoft.com/devcontainers/python:3",
"image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm",
"name": "A Python3, async interface to the Hilo API",
"updateContentCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install && poetry run pre-commit install"
"postCreateCommand": "uv sync && uv run pre-commit install"
}
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

6 changes: 1 addition & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ updates:
directory: "/"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: weekly
- package-ecosystem: pip
- package-ecosystem: uv
directory: "/"
schedule:
interval: weekly
5 changes: 0 additions & 5 deletions .github/workflows/constraints.txt

This file was deleted.

39 changes: 28 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linting
name: CI

on:
push:
Expand All @@ -23,17 +23,34 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install uv
uses: astral-sh/[email protected]

- name: Install dependencies
run: uv sync

- name: Install Python modules
run: |
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports

- name: Run pre-commit on all files
env:
SKIP: no-commit-to-branch
run: |
pre-commit run --all-files --show-diff-on-failure --color=always
run: uv run pre-commit run --all-files --show-diff-on-failure --color=always

tests:
runs-on: "ubuntu-latest"
name: Tests
steps:
- name: Check out the repository
uses: actions/checkout@v6

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Install uv
uses: astral-sh/[email protected]

- name: Install dependencies
run: uv sync

- name: Run tests
run: uv run pytest -v
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

29 changes: 8 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ repos:
- --format=custom
- --configfile=.bandit.yaml
files: ^pyhilo/.+\.py$
- repo: https://github.com/psf/black
rev: 24.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.9
hooks:
- id: black
args:
- --safe
- --quiet
language_version: python3
files: ^((pyhilo|tests)/.+)?[^/]+\.py$
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
files: ^pyhilo/.+\.py$
- id: ruff-format
args: [--quiet]
files: ^pyhilo/.+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand All @@ -27,19 +27,6 @@ repos:
- --quiet-level=4
- -L ba,hass,manuel,connexion
exclude_types: [json]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.7.0
- pydocstyle==6.3.0
files: ^pyhilo/.+\.py$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
files: ^(pyhilo|tests)/.+\.py$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

66 changes: 0 additions & 66 deletions .yamllint

This file was deleted.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,32 @@ the [Dev Container][devcontainer] feature of Visual Studio Code.

[![Open in Dev Containers][devcontainer-shield]][devcontainer]

This Python project is fully managed using the [Poetry][poetry] dependency
manager. But also relies on the use of NodeJS for certain checks during
development.
This Python project uses [uv][uv] for dependency management and [ruff][ruff]
for formatting and linting.

You need at least:

- Python 3.11+
- [Poetry][poetry-install]
- NodeJS 20+ (including NPM)
- [uv][uv]

To install all packages, including all development requirements:

```bash
npm install
poetry install
uv sync
```

As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:

```bash
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
```

To run just the Python tests:

```bash
poetry run pytest
uv run pytest
```

## Authors & contributors
Expand All @@ -84,6 +81,8 @@ check [the contributor's page][contributors].
[poetry-install]: https://python-poetry.org/docs/#installation
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com/
[uv]: https://docs.astral.sh/uv/
[ruff]: https://docs.astral.sh/ruff/
[dvd-dev]: https://github.com/dvd-dev
[frenck]: https://github.com/frenck
[contributors]: https://github.com/dvd-dev/python-hilo/graphs/contributors
32 changes: 0 additions & 32 deletions package-lock.json

This file was deleted.

14 changes: 0 additions & 14 deletions package.json

This file was deleted.

Loading
Loading