diff --git a/.editorconfig b/.editorconfig index 30e6922..5163372 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,7 @@ trim_trailing_whitespace = true [{.babelrc,.compressrc,.eslintrc,.linguirc}] indent_size = 2 -[*.{css,cfg,html,ini,j2,js,json,md,service,toml,yaml,yml,xml}] +[*.{css,cfg,gql,html,ini,j2,js,json,jsx,md,service,toml,ts,tsx,yaml,yml,xml}] indent_size = 2 [*.{nginx,nginx.j2,py,rst,sh}] diff --git a/.flake8 b/.flake8 index be72b6e..e53ba58 100644 --- a/.flake8 +++ b/.flake8 @@ -3,12 +3,9 @@ ban-relative-imports = true classmethod-decorators = classmethod validator -extend-ignore = E501, PIE786 -extend-select = TC, TC1 +extend-ignore = + E501 + PIE786 inline-quotes = double max-complexity = 15 multiline-quotes = double -per-file-ignores = - */models.py: TC - */models/*.py: TC -type-checking-strict = true diff --git a/.github/actions/install_badabump/action.yml b/.github/actions/install_badabump/action.yml index d0c1619..8a7b0bc 100644 --- a/.github/actions/install_badabump/action.yml +++ b/.github/actions/install_badabump/action.yml @@ -12,7 +12,7 @@ runs: steps: - id: "python" name: "Install Python" - uses: "actions/setup-python@v5.0.0" + uses: "actions/setup-python@v5.1.1" with: python-version-file: ".python-version" diff --git a/.github/actions/install_python_and_poetry/action.yml b/.github/actions/install_python_and_poetry/action.yml index 22486e7..016c1ac 100644 --- a/.github/actions/install_python_and_poetry/action.yml +++ b/.github/actions/install_python_and_poetry/action.yml @@ -18,7 +18,7 @@ inputs: poetry-version: description: "Poetry version to use" required: false - default: "1.7.1" + default: "1.8.3" outputs: python-path: @@ -39,7 +39,7 @@ runs: steps: - id: "python" name: "Install Python" - uses: "actions/setup-python@v5.0.0" + uses: "actions/setup-python@v5.1.1" with: python-version: "${{ inputs.python-version }}" python-version-file: "${{ inputs.python-version-file }}" @@ -49,7 +49,7 @@ runs: run: "pipx install --python='${{ steps.python.outputs.python-path }}' poetry==${{ inputs.poetry-version }}" - name: "Cache venv" - uses: "actions/cache@v4.0.0" + uses: "actions/cache@v4.0.2" with: path: "./.venv/" key: "venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}${{ inputs.cache-key-suffix }}" diff --git a/.github/actions/run_pre_commit/action.yml b/.github/actions/run_pre_commit/action.yml index 9df505c..50180f1 100644 --- a/.github/actions/run_pre_commit/action.yml +++ b/.github/actions/run_pre_commit/action.yml @@ -14,7 +14,7 @@ runs: shell: "bash" - name: "Cache mypy" - uses: "actions/cache@v4.0.0" + uses: "actions/cache@v4.0.2" with: path: "./.mypy_cache/" key: "mypy-${{ runner.os }}-${{ inputs.python-version }}" diff --git a/.github/actions/run_tox/action.yml b/.github/actions/run_tox/action.yml index 9f7744f..833b81e 100644 --- a/.github/actions/run_tox/action.yml +++ b/.github/actions/run_tox/action.yml @@ -13,7 +13,7 @@ inputs: tox-version: description: "Tox version to use" required: false - default: "4.12.1" + default: "4.18.0" tox-gh-actions-version: description: "Tox GitHub Actions plugin version to use" @@ -41,7 +41,7 @@ runs: shell: "bash" - name: "Cache tox" - uses: "actions/cache@v4.0.0" + uses: "actions/cache@v4.0.2" with: path: ".tox/" key: "tox-${{ inputs.python-version }}" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e34d820..6aec5aa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,6 +15,9 @@ updates: - "dependencies" allow: - dependency-type: "direct" + groups: + dev-dependencies: + dependency-type: "development" - package-ecosystem: "github-actions" directory: "/" @@ -30,3 +33,6 @@ updates: - "build" - "ci" - "dependencies" + groups: + ci-dependencies: + patterns: ["*"] diff --git a/.github/workflows/ci_package.yml b/.github/workflows/ci_package.yml index a9188a3..9dc7a69 100644 --- a/.github/workflows/ci_package.yml +++ b/.github/workflows/ci_package.yml @@ -7,7 +7,7 @@ on: description: "Twine version to use." type: "string" required: false - default: "4.0.2" + default: "5.1.1" jobs: package: @@ -16,7 +16,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v4.1.1" + - uses: "actions/checkout@v4.1.7" - id: "python_and_poetry" uses: "./.github/actions/install_python_and_poetry" @@ -34,4 +34,4 @@ jobs: - name: "Publish package" if: "${{ startsWith(github.ref, 'refs/tags/') }}" - uses: "pypa/gh-action-pypi-publish@v1.8.11" + uses: "pypa/gh-action-pypi-publish@v1.9.0" diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index 5f0a5dd..e86b05c 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -14,7 +14,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v4.1.1" + - uses: "actions/checkout@v4.1.7" - name: "Fetch git data" run: | diff --git a/.github/workflows/ci_verify_docs_build.yml b/.github/workflows/ci_verify_docs_build.yml index b9dbfeb..7d01b27 100644 --- a/.github/workflows/ci_verify_docs_build.yml +++ b/.github/workflows/ci_verify_docs_build.yml @@ -14,7 +14,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v4.1.1" + - uses: "actions/checkout@v4.1.7" - id: "python_and_poetry" uses: "./.github/actions/install_python_and_poetry" diff --git a/.github/workflows/release_pr.yml b/.github/workflows/release_pr.yml index c1c80e1..3806464 100644 --- a/.github/workflows/release_pr.yml +++ b/.github/workflows/release_pr.yml @@ -23,7 +23,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v4.1.1" + - uses: "actions/checkout@v4.1.7" with: ref: "main" @@ -47,7 +47,7 @@ jobs: private_key: "${{ secrets.BADABUMP_APP_PRIVATE_KEY }}" - name: "Create pull request with changed files" - uses: "peter-evans/create-pull-request@v6.0.0" + uses: "peter-evans/create-pull-request@v6.1.0" with: token: "${{ steps.token.outputs.token }}" commit-message: | diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml index eca2d01..043c47d 100644 --- a/.github/workflows/release_tag.yml +++ b/.github/workflows/release_tag.yml @@ -25,7 +25,7 @@ jobs: app_id: "${{ secrets.BADABUMP_APP_ID }}" private_key: "${{ secrets.BADABUMP_APP_PRIVATE_KEY }}" - - uses: "actions/checkout@v4.1.1" + - uses: "actions/checkout@v4.1.7" with: ref: "main" token: "${{ steps.token.outputs.token }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 143efe7..b0bd6b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,6 @@ +default_install_hook_types: + - "commit-msg" + - "pre-commit" default_language_version: python: &python_version "python3.12" exclude: ^(archive|assets|migrations)/.*|.*/(migrations|test-data|vendor)/.*|.*\.svg$ @@ -5,12 +8,9 @@ minimum_pre_commit_version: "1.17.0" repos: - repo: "https://github.com/commitizen-tools/commitizen" - rev: "v3.14.1" + rev: "v3.29.0" hooks: - id: "commitizen" - # By default commitizen using `python3` language version, so - # needed to provide concrete version here as well - language_version: *python_version stages: ["commit-msg"] - repo: "https://github.com/Kludex/no-optional" @@ -27,23 +27,23 @@ repos: exclude: ^docs/.*$ - repo: "https://github.com/psf/black-pre-commit-mirror" - rev: "24.1.1" + rev: "24.8.0" hooks: - id: "black" name: "Format code (black)" exclude: ^docs/.*$ - repo: "https://github.com/asottile/blacken-docs" - rev: "1.16.0" + rev: "1.18.0" hooks: - id: "blacken-docs" name: "Format docs (blacken-docs)" args: ["-l", "64"] additional_dependencies: - - "black==23.7.0" + - "black==24.8.0" - repo: "https://github.com/pre-commit/pre-commit-hooks" - rev: "v4.5.0" + rev: "v4.6.0" hooks: - id: "end-of-file-fixer" - id: "trailing-whitespace" @@ -61,24 +61,25 @@ repos: - id: "rst-inline-touching-normal" - repo: "https://github.com/PyCQA/flake8" - rev: "7.0.0" + rev: "7.1.1" hooks: - id: "flake8" name: "Lint code (flake8)" additional_dependencies: &flake8_additional_dependencies - - "flake8-bugbear==24.2.6" - - "flake8-builtins==2.2.0" - - "flake8-comprehensions==3.14.0" + - "flake8-bugbear==24.4.26" + - "flake8-builtins==2.5.0" + - "flake8-comprehensions==3.15.0" - "flake8-implicit-str-concat==0.4.0" - "flake8-isort==6.1.1" + - "flake8-logging==1.6.0" - "flake8-mutable==1.2.0" - "flake8-pie==0.16.0" - - "flake8-quotes==3.3.2" + - "flake8-quotes==3.4.0" - "flake8-string-format==0.3.0" - "flake8-tidy-imports==4.10.0" - "flake8-variables-names==0.0.6" - - "flake8==7.0.0" - - "pep8-naming==0.13.3" + - "flake8==7.1.1" + - "pep8-naming==0.14.1" exclude: ^docs/.*$ - repo: "https://github.com/asottile/yesqa" @@ -100,7 +101,7 @@ repos: exclude: ^(.*/)?(docs|migrations|tests)/.*$ - repo: "https://github.com/shellcheck-py/shellcheck-py" - rev: "v0.9.0.6" + rev: "v0.10.0.1" hooks: - id: "shellcheck" name: "Lint scripts (shellcheck)" diff --git a/.python-version b/.python-version index 8531a3b..d9506ce 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12.2 +3.12.5 diff --git a/src/aiohttp_middlewares/error.py b/src/aiohttp_middlewares/error.py index 4da2615..7755ea4 100644 --- a/src/aiohttp_middlewares/error.py +++ b/src/aiohttp_middlewares/error.py @@ -137,7 +137,7 @@ async def default_error_handler(request: web.Request) -> web.Response: .. versionadded:: 1.0.0 """ with error_context(request) as context: - logger.error(context.message, exc_info=True) + logger.error(context.message, exc_info=True) # noqa: LOG014 return web.json_response(context.data, status=context.status)