From 163ef53d15b50520cebfdbda3da10d3fdd8601a5 Mon Sep 17 00:00:00 2001 From: Maxim Martynov Date: Mon, 8 Apr 2024 18:03:39 +0300 Subject: [PATCH] Update pre-commit hooks --- .github/dependabot.yml | 12 +- .github/workflows/automerge.yml | 14 +- .github/workflows/codeql-analysis.yml | 74 ++++----- .github/workflows/dev-release.yml | 72 ++++----- .github/workflows/release.yml | 108 ++++++------- .github/workflows/test.yml | 208 +++++++++++++------------- .pre-commit-config.yaml | 167 +++++++++++---------- .readthedocs.yml | 6 +- 8 files changed, 337 insertions(+), 324 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cc083ee..021311e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,9 +2,9 @@ version: 2 updates: -- package-ecosystem: github-actions - directory: / - schedule: - interval: daily - labels: - - ci + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + labels: + - ci diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1c6b275..429f466 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,10 +10,10 @@ jobs: if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]' steps: - - uses: alexwilson/enable-github-automerge-action@2.0.0 - with: - github-token: ${{ secrets.PERSONAL_TOKEN }} - merge-method: REBASE + - uses: alexwilson/enable-github-automerge-action@2.0.0 + with: + github-token: ${{ secrets.PERSONAL_TOKEN }} + merge-method: REBASE autoapprove: name: Automatically approve pull request @@ -22,6 +22,6 @@ jobs: if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]' steps: - - uses: hmarr/auto-approve-action@v4 - with: - github-token: ${{ secrets.PERSONAL_TOKEN }} + - uses: hmarr/auto-approve-action@v4 + with: + github-token: ${{ secrets.PERSONAL_TOKEN }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 19d7a30..26d14a8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,12 +3,12 @@ name: CodeQL on: push: branches: - - '**' + - '**' pull_request: branches: - - master + - master schedule: - - cron: 45 13 * * 6 + - cron: 45 13 * * 6 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} @@ -27,43 +27,43 @@ jobs: security-events: write steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.DEFAULT_PYTHON }} + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }} - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql- - ${{ runner.os }}-python - ${{ runner.os }}- + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }} + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql- + ${{ runner.os }}-python + ${{ runner.os }}- - - name: Upgrade pip - run: python -m pip install --upgrade pip setuptools wheel + - name: Upgrade pip + run: python -m pip install --upgrade pip setuptools wheel - - name: Install dependencies - run: | - pip install -I -r requirements.txt -r requirements-dev.txt - # Set the `CODEQL-PYTHON` environment variable to the Python executable - # that includes the dependencies - echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV + - name: Install dependencies + run: | + pip install -I -r requirements.txt -r requirements-dev.txt + # Set the `CODEQL-PYTHON` environment variable to the Python executable + # that includes the dependencies + echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV - - name: Run flake8 - run: flake8 --count --max-line-length=120 . + - name: Run flake8 + run: flake8 --count --max-line-length=120 . # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: python + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: python # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. @@ -71,7 +71,7 @@ jobs: # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: /language:python + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: /language:python diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 6c03162..a3a88ac 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -3,8 +3,8 @@ name: Dev release on: push: branches-ignore: - - dependabot/** - - pre-commit-ci-update-config + - dependabot/** + - pre-commit-ci-update-config workflow_dispatch: env: @@ -27,45 +27,45 @@ jobs: id-token: write # to auth in Test PyPI steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.DEFAULT_PYTHON }} + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- - ${{ runner.os }}-python - ${{ runner.os }}- + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- + ${{ runner.os }}-python + ${{ runner.os }}- - - name: Upgrade pip - run: python -m pip install --upgrade pip setuptools wheel + - name: Upgrade pip + run: python -m pip install --upgrade pip setuptools wheel - - name: Install dependencies - run: pip install -r requirements.txt + - name: Install dependencies + run: pip install -r requirements.txt - - name: Patch setup.py with explicit version number + - name: Patch setup.py with explicit version number # Fix for https://github.com/dolfinus/setuptools-git-versioning/issues/72#issuecomment-1312589464 - run: | - version=$(python setup.py --version) - sed -i -E "/from setuptools_git_versioning.*/d" setup.py - sed -i -E "s/version=.*/version='${version}',/" setup.py + run: | + version=$(python setup.py --version) + sed -i -E "/from setuptools_git_versioning.*/d" setup.py + sed -i -E "s/version=.*/version='${version}',/" setup.py - - name: Build package - run: python setup.py sdist bdist_wheel + - name: Build package + run: python setup.py sdist bdist_wheel - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository_url: https://test.pypi.org/legacy/ + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68fd793..8681bd7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - v* + - v* env: DEFAULT_PYTHON: '3.12' @@ -22,67 +22,67 @@ jobs: contents: write # to create Github release steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.DEFAULT_PYTHON }} + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- - ${{ runner.os }}-python - ${{ runner.os }}- + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- + ${{ runner.os }}-python + ${{ runner.os }}- - - name: Upgrade pip - run: python -m pip install --upgrade pip setuptools wheel + - name: Upgrade pip + run: python -m pip install --upgrade pip setuptools wheel - - name: Install dependencies - run: pip install -r requirements.txt -r requirements-doc.txt + - name: Install dependencies + run: pip install -r requirements.txt -r requirements-doc.txt - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.x + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4.x - - name: Patch setup.py with explicit version number + - name: Patch setup.py with explicit version number # Fix for https://github.com/dolfinus/setuptools-git-versioning/issues/72#issuecomment-1312589464 - run: | - version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") - sed -i -E "/from setuptools_git_versioning.*/d" setup.py - sed -i -E "s/version=.*/version='${version}',/" setup.py + run: | + version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") + sed -i -E "/from setuptools_git_versioning.*/d" setup.py + sed -i -E "s/version=.*/version='${version}',/" setup.py - - name: Build package - run: python setup.py sdist bdist_wheel + - name: Build package + run: python setup.py sdist bdist_wheel - - name: Build release notes - run: | - mkdir reports/ - pip install -e . - version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") - # lines 1 and 3 are empty, line 2 contains version number, line 4 contains release date - changelog generate-md -c ./docs/conf.py CHANGELOG.rst -v $version | sed "1,4d" > reports/release.md - sed -i -E 's/:github-user:`(.*)`/@\1/g' reports/release.md - sed -i -E 's/:issue:`(.*)`/#\1/g' reports/release.md - sed -i -E 's/:pr:`(.*)`/#\1/g' reports/release.md + - name: Build release notes + run: | + mkdir reports/ + pip install -e . + version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") + # lines 1 and 3 are empty, line 2 contains version number, line 4 contains release date + changelog generate-md -c ./docs/conf.py CHANGELOG.rst -v $version | sed "1,4d" > reports/release.md + sed -i -E 's/:github-user:`(.*)`/@\1/g' reports/release.md + sed -i -E 's/:issue:`(.*)`/#\1/g' reports/release.md + sed -i -E 's/:pr:`(.*)`/#\1/g' reports/release.md - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 - - name: Create Github release - id: create_release - uses: softprops/action-gh-release@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - draft: false - prerelease: false - body_path: reports/release.md - files: | - dist/* + - name: Create Github release + id: create_release + uses: softprops/action-gh-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + prerelease: false + body_path: reports/release.md + files: | + dist/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac6f95e..f5458fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,11 +2,11 @@ name: Tests on: push: branches-ignore: - - dependabot/** - - pre-commit-ci-update-config + - dependabot/** + - pre-commit-ci-update-config pull_request: branches: - - master + - master workflow_dispatch: concurrency: @@ -28,63 +28,63 @@ jobs: # run only limited set of tests because it takes too long mark: [important] include: - - os: macos-latest - mark: important - python-version: '3.12' - - os: windows-latest - mark: important - python-version: '3.12' + - os: macos-latest + mark: important + python-version: '3.12' + - os: windows-latest + mark: important + python-version: '3.12' # run all the tests only on latest python version - - os: ubuntu-latest - mark: all - python-version: '3.12' + - os: ubuntu-latest + mark: all + python-version: '3.12' steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }} - ${{ runner.os }}-python-${{ matrix.python-version }}-tests- - ${{ runner.os }}-python - ${{ runner.os }}- - - - name: Upgrade pip - run: python -m pip install --upgrade pip setuptools wheel - - - name: Install dependencies - run: pip install -I -r requirements.txt -r requirements-test.txt - - - name: Build package - run: | - git version - git tag -l --sort=-creatordate --merged - python setup.py --version - python setup.py bdist_wheel sdist - - - name: Run tests - run: | - mkdir reports/ - pip install -e . --no-build-isolation - coverage run -m pytest -m ${{ matrix.mark }} - - - name: Upload coverage results - uses: actions/upload-artifact@v4 - with: - name: code-coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.mark }} - path: reports/.coverage* + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }} + ${{ runner.os }}-python-${{ matrix.python-version }}-tests- + ${{ runner.os }}-python + ${{ runner.os }}- + + - name: Upgrade pip + run: python -m pip install --upgrade pip setuptools wheel + + - name: Install dependencies + run: pip install -I -r requirements.txt -r requirements-test.txt + + - name: Build package + run: | + git version + git tag -l --sort=-creatordate --merged + python setup.py --version + python setup.py bdist_wheel sdist + + - name: Run tests + run: | + mkdir reports/ + pip install -e . --no-build-isolation + coverage run -m pytest -m ${{ matrix.mark }} + + - name: Upload coverage results + uses: actions/upload-artifact@v4 + with: + name: code-coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.mark }} + path: reports/.coverage* all_done: name: Tests done @@ -92,50 +92,50 @@ jobs: needs: [tests] steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }} - ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests- - ${{ runner.os }}-python - ${{ runner.os }}- - - - name: Upgrade pip - run: python -m pip install --upgrade pip setuptools wheel - - - name: Install dependencies - run: pip install -I -r requirements.txt -r requirements-test.txt - - - name: Download all coverage reports - uses: actions/download-artifact@v4 - with: - path: reports - - - name: Move coverage reports to the root folder - run: find reports -type f -exec mv '{}' reports \; - - - name: Combine coverage - run: | - coverage combine - coverage xml -o reports/coverage.xml -i - - - name: Check coverage - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./reports - fail_ci_if_error: true - - - name: All done - run: echo 1 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }} + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests- + ${{ runner.os }}-python + ${{ runner.os }}- + + - name: Upgrade pip + run: python -m pip install --upgrade pip setuptools wheel + + - name: Install dependencies + run: pip install -I -r requirements.txt -r requirements-test.txt + + - name: Download all coverage reports + uses: actions/download-artifact@v4 + with: + path: reports + + - name: Move coverage reports to the root folder + run: find reports -type f -exec mv '{}' reports \; + + - name: Combine coverage + run: | + coverage combine + coverage xml -o reports/coverage.xml -i + + - name: Check coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./reports + fail_ci_if_error: true + + - name: All done + run: echo 1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7f191a..0ae8aad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,78 +1,91 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-ast - - id: check-case-conflict - - id: check-docstring-first - - id: check-merge-conflict - - id: check-vcs-permalinks - - id: check-yaml - - id: requirements-txt-fixer - files: ^(requirements.*\.txt)$ - - id: end-of-file-fixer - - id: fix-byte-order-marker - - id: fix-encoding-pragma - args: [--remove] - - id: name-tests-test - files: ^tests\/test_(unit|integration)\/.*\.py$ - args: [--django] - - id: trailing-whitespace - - id: detect-private-key -- repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.3 - hooks: - - id: remove-tabs -- repo: https://github.com/codespell-project/codespell - rev: v2.2.5 - hooks: - - id: codespell - args: [-w] -- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.10.0 - hooks: - - id: pretty-format-yaml - args: [--autofix, --indent, '2'] -- repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - files: setuptools_git_versioning.py -- repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.10.0 - hooks: - - id: python-no-log-warn - - id: python-no-eval - - id: text-unicode-replacement-char -- repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 - hooks: - - id: pyupgrade - args: [--py37-plus] -- repo: https://github.com/psf/black - rev: 23.7.0 - hooks: - - id: black - language_version: python3 -- repo: https://github.com/asottile/blacken-docs - rev: 1.15.0 - hooks: - - id: blacken-docs -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 - hooks: - - id: mypy - additional_dependencies: [types-six, types-toml] -- repo: https://github.com/pycqa/flake8 - rev: 6.1.0 - hooks: - - id: flake8 -- repo: https://github.com/PyCQA/bandit - rev: 1.7.5 - hooks: - - id: bandit - args: [-c, bandit.yaml] -- repo: meta - hooks: - - id: check-hooks-apply - - id: check-useless-excludes + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-vcs-permalinks + - id: check-yaml + - id: requirements-txt-fixer + files: ^(requirements.*\.txt)$ + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: fix-encoding-pragma + args: [--remove] + - id: name-tests-test + files: ^tests\/test_(unit|integration)\/.*\.py$ + args: [--django] + - id: trailing-whitespace + - id: detect-private-key + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: remove-tabs + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + args: [-w] + + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.13.0 + hooks: + - id: pretty-format-yaml + args: [--autofix, --indent, '2', --preserve-quotes, --offset, '2'] + + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + files: setuptools_git_versioning.py + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-no-log-warn + - id: python-no-eval + - id: text-unicode-replacement-char + + - repo: https://github.com/asottile/pyupgrade + rev: v3.15.2 + hooks: + - id: pyupgrade + args: [--py37-plus] + + - repo: https://github.com/psf/black + rev: 24.3.0 + hooks: + - id: black + language_version: python3 + + - repo: https://github.com/asottile/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + additional_dependencies: [black==24.3.0] + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.9.0 + hooks: + - id: mypy + additional_dependencies: [types-six, types-toml] + + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + + - repo: https://github.com/PyCQA/bandit + rev: 1.7.8 + hooks: + - id: bandit + args: [-c, bandit.yaml] + + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes diff --git a/.readthedocs.yml b/.readthedocs.yml index 1c48963..5fdb405 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,9 +6,9 @@ build: python: '3.12' jobs: post_checkout: - - git fetch --unshallow || true + - git fetch --unshallow || true python: install: - - requirements: requirements-doc.txt - - requirements: requirements.txt + - requirements: requirements-doc.txt + - requirements: requirements.txt