Skip to content

Commit

Permalink
fix: blocking call in aioweenect (#377)
Browse files Browse the repository at this point in the history
* fix blocking call in aioweenect

* no lock
  • Loading branch information
eifinger authored Aug 4, 2024
1 parent d215f5d commit f49f51b
Show file tree
Hide file tree
Showing 30 changed files with 673 additions and 3,087 deletions.
6 changes: 0 additions & 6 deletions .codecov.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

36 changes: 19 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,32 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: eifinger/setup-rye@v4
id: setup-rye
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
enable-cache: true
cache-prefix: ${{ matrix.python-version }}
- name: Pin python-version ${{ matrix.python-version }}
run: rye pin ${{ matrix.python-version }}
- name: Install dependencies
if: steps.setup-rye.outputs.cache-hit != 'true'
run: |
poetry install
rye sync
- name: Cache pre-commit
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/pre-commit
key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Lint
run: |
SKIP=no-commit-to-branch poetry run pre-commit run --all-files
- name: Coverage
run: |
poetry run coverage xml -i
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
with:
token: ${{secrets.CODECOV}}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
rye run pre-commit run --all-files
env:
SKIP: no-commit-to-branch
- name: Lint GitHub Actions
uses: eifinger/actionlint-action@v1
hacs:
name: HACS Action
runs-on: "ubuntu-latest"
Expand Down
105 changes: 38 additions & 67 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,69 @@
---
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
hooks:
- id: prettier
name: 💄 Ensuring files are prettier
types: [yaml, json, markdown]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: "v0.9.0"
hooks:
- id: shellcheck
name: ✅ Check Shell files
- repo: local
hooks:
- id: black
name: ☕️ Format using black
- id: ruff
name: ✅ Format using ruff
types: [python]
language: system
entry: rye run ruff format
- id: ruff
name: ✅ Lint using ruff
types: [python]
entry: poetry run black
require_serial: true
- id: blacken-docs
name: ☕️ Format documentation examples using black
language: system
files: '\.(rst|md|markdown|py|tex)$'
entry: poetry run blacken-docs
require_serial: true
entry: rye run ruff check
args: [--fix, --exit-non-zero-on-fix]
- id: check-ast
name: 🐍 Check Python AST
language: system
types: [python]
entry: poetry run check-ast
entry: rye run check-ast
- id: check-case-conflict
name: 🔠 Check for case conflicts
language: system
entry: poetry run check-case-conflict
entry: rye run check-case-conflict
- id: check-docstring-first
name: ℹ️ Check docstring is first
language: system
types: [python]
entry: poetry run check-docstring-first
entry: rye run check-docstring-first
- id: check-executables-have-shebangs
name: 🧐 Check that executables have shebangs
language: system
types: [text, executable]
entry: poetry run check-executables-have-shebangs
entry: rye run check-executables-have-shebangs
stages: [commit, push, manual]
- id: check-json
name: { Check JSON files
language: system
types: [json]
entry: poetry run check-json
entry: rye run check-json
- id: check-merge-conflict
name: 💥 Check for merge conflicts
language: system
types: [text]
entry: poetry run check-merge-conflict
entry: rye run check-merge-conflict
- id: check-symlinks
name: 🔗 Check for broken symlinks
language: system
types: [symlink]
entry: poetry run check-symlinks
entry: rye run check-symlinks
- id: check-toml
name: ✅ Check TOML files
language: system
types: [toml]
entry: poetry run check-toml
entry: rye run check-toml
- id: check-xml
name: ✅ Check XML files
entry: check-xml
Expand All @@ -63,96 +73,57 @@ repos:
name: ✅ Check YAML files
language: system
types: [yaml]
entry: poetry run check-yaml
entry: rye run check-yaml
- id: codespell
name: ✅ Check code for common misspellings
language: system
types: [text]
exclude: |
(?x)^(
poetry.lock|
CHANGELOG.md
.lock
)$
entry: poetry run codespell --ignore-words=.codespell
entry: rye run codespell --ignore-words=.codespell
- id: debug-statements
name: 🪵 Debug Statements and imports (Python)
language: system
types: [python]
entry: poetry run debug-statement-hook
entry: rye run debug-statement-hook
- id: detect-private-key
name: 🕵️ Detect Private Keys
language: system
types: [text]
entry: poetry run detect-private-key
entry: rye run detect-private-key
- id: end-of-file-fixer
name: ⮐ Fix End of Files
language: system
types: [text]
entry: poetry run end-of-file-fixer
entry: rye run end-of-file-fixer
stages: [commit, push, manual]
- id: fix-byte-order-marker
name: 🚏 Fix UTF-8 byte order marker
language: system
types: [text]
entry: poetry run fix-byte-order-marker
entry: rye run fix-byte-order-marker
- id: mypy
name: 🆎 Static type checking using mypy
language: system
types: [python]
entry: poetry run mypy
entry: rye run mypy
require_serial: true
- id: no-commit-to-branch
name: 🛑 Don't commit to main branch
language: system
entry: poetry run no-commit-to-branch
pass_filenames: false
always_run: true
args:
- --branch=main
- id: poetry
name: 📜 Check pyproject with Poetry
language: system
entry: poetry check
pass_filenames: false
always_run: true
- id: pytest
name: 🧪 Running tests and test coverage with pytest
language: system
types: [python]
entry: poetry run pytest
entry: rye run pytest
pass_filenames: false
- id: trailing-whitespace
name: ✄ Trim Trailing Whitespace
language: system
types: [text]
entry: poetry run trailing-whitespace-fixer
entry: rye run trailing-whitespace-fixer
stages: [commit, push, manual]
- id: vulture
name: 🔍 Find unused Python code with Vulture
language: system
types: [python]
entry: poetry run vulture
pass_filenames: false
require_serial: true
- id: yamllint
name: 🎗 Check YAML files with yamllint
language: system
types: [yaml]
entry: poetry run yamllint
- id: ruff
name: ⚡️ Check with ruff
language: system
entry: poetry run ruff check
types: [python]
args: ["--force-exclude"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
hooks:
- id: prettier
name: 💄 Ensuring files are prettier
types: [yaml, json, markdown]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: "v0.9.0"
hooks:
- id: shellcheck
name: ✅ Check Shell files
entry: rye run yamllint
65 changes: 0 additions & 65 deletions .pylintrc

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.0
Loading

0 comments on commit f49f51b

Please sign in to comment.