Skip to content

Commit

Permalink
feat: py312
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Jul 31, 2024
1 parent 2040200 commit 652b0d1
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 233 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@main
Expand Down
19 changes: 13 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

fail_fast: true
default_install_hook_types: [commit-msg, pre-commit, pre-push]

repos:

- repo: https://github.com/qoomon/git-conventional-commits
rev: 'v2.6.5'
rev: 'v2.6.7'
hooks:
- id: conventional-commits
args: ["-c", ".git-commits.yaml"]
stages: ["commit-msg"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-case-conflict
stages: ["pre-commit"]
- id: check-merge-conflict
stages: ["pre-commit"]
- id: check-added-large-files
stages: ["pre-commit"]
args: ['--maxkb=5000']
- id: check-ast
stages: ["pre-commit"]
- id: check-executables-have-shebangs
Expand All @@ -39,7 +41,7 @@ repos:
stages: ["pre-commit"]

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black
stages: ["pre-commit"]
Expand All @@ -48,30 +50,35 @@ repos:
rev: '1.5.0'
hooks:
- id: poetry-check
files: ^(.*/)?pyproject\.toml$
stages: ["pre-commit"]
- id: poetry-lock
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$
args: ["--no-update"]
stages: ["pre-commit"]

- repo: local
hooks:
- id: ruff
name: ruff
entry: poetry run ruff muffin_sentry
entry: ruff check muffin_sentry
language: system
pass_filenames: false
files: \.py$
stages: ["pre-commit"]

- id: mypy
name: mypy
entry: poetry run mypy
entry: mypy
language: system
pass_filenames: false
files: \.py$
stages: ["pre-push"]

- id: pytest
name: pytest
entry: poetry run pytest tests.py
entry: pytest
language: system
pass_filenames: false
files: \.py$
stages: ["pre-push"]
6 changes: 3 additions & 3 deletions muffin_sentry/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from contextvars import ContextVar
from functools import partial
from typing import TYPE_CHECKING, Callable, ClassVar, Dict, List, Optional, TypeVar
from typing import TYPE_CHECKING, Callable, ClassVar, Optional, TypeVar

from muffin import Application, Request, ResponseError, ResponseRedirect
from muffin.plugins import BasePlugin
Expand Down Expand Up @@ -40,12 +40,12 @@ class Plugin(BasePlugin):

name = "sentry"
client = None
defaults: ClassVar[Dict] = {
defaults: ClassVar[dict] = {
"dsn": "", # Sentry DSN
"sdk_options": {}, # See https://docs.sentry.io/platforms/python/configuration/options/
"ignore_errors": (ResponseError, ResponseRedirect),
}
processors: List[TProcess]
processors: list[TProcess]

def __init__(self, *args, **kwargs):
"""Initialize the plugin."""
Expand Down
Loading

0 comments on commit 652b0d1

Please sign in to comment.