From 9049b21c02e6fabaff5690e8cbfd04fb142ef825 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 01:37:48 +0100 Subject: [PATCH 1/6] Sync with latest standards --- .pre-commit-config.yaml | 49 ++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ac1b0f..3a7e6e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ -exclude: '^$|venv|.obsidian' +exclude: "^$|venv|.obsidian" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,29 +11,41 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 24.4.2 hooks: - id: black - language_version: python3.10 - - repo: https://github.com/humitos/mirrors-autoflake.git - rev: v1.1 + language_version: python3.12 + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 hooks: - id: autoflake - args: ['--in-place', '--remove-unused-variable'] + args: [--remove-all-unused-imports, --in-place] - repo: https://github.com/PyCQA/isort - rev: 5.11.4 + rev: 5.13.2 hooks: - id: isort - args: ['--line-length=79'] - language_version: python3.10 + args: ["--profile", "black", "--filter-files", "--line-length=79"] + language_version: python3.12 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + additional_dependencies: + [ + types-requests, + types-PyYAML, + types-Flask, + types-Werkzeug, + types-Markdown, + ] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.2 hooks: - id: pyupgrade args: - - --py37-plus + - --py38-plus - repo: https://github.com/andreoliwa/nitpick - rev: v0.32.0 + rev: v0.35.0 hooks: - id: nitpick - repo: https://github.com/pre-commit/pygrep-hooks @@ -44,3 +56,14 @@ repos: - id: python-no-eval - id: python-no-log-warn - id: rst-backticks + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + - repo: https://github.com/MartinThoma/check-pip-compile + rev: 0.1.1 + hooks: + - id: check-pip-compile + args: ["."] +default_language_version: + python: python3.11 From 76b63406cf725dec929050a083adbdddbf6ddcb9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 00:38:59 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/dependabot.yml | 16 ++++----- .github/workflows/python.yml | 67 ++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3112be5..7eed1bb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,10 @@ version: 2 updates: -- package-ecosystem: pip - directory: / - schedule: - interval: daily -- package-ecosystem: github-actions - directory: / - schedule: - interval: daily + - package-ecosystem: pip + directory: / + schedule: + interval: daily + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 0a070df..e44f5ec 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -4,43 +4,42 @@ on: [push] jobs: build: - runs-on: ubuntu-latest strategy: matrix: python-version: [3.7, 3.8, 3.9, "3.10"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3.2.3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install build tools - run: | - python -m pip install --upgrade pip - pip install -U black pylama wheel pip tox - pip install . - - name: Set build name - run: echo "::set-output name=${GITHUB_REPOSITORY}-$(python setup.py --version)" - - name: Lint - run: | - - name: Run Tox - # Run tox using the version of Python in `PATH` - run: tox -e py - - name: Build Package - if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: | - python setup.py bdist - - name: Publish package - if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v3.2.3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install -U black pylama wheel pip tox + pip install . + - name: Set build name + run: echo "::set-output name=${GITHUB_REPOSITORY}-$(python setup.py --version)" + - name: Lint + run: | + - name: Run Tox + # Run tox using the version of Python in `PATH` + run: tox -e py + - name: Build Package + if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: | + python setup.py bdist + - name: Publish package + if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} From 263ff63c5db57f4b07625f3d03dca19b4d6228a6 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 12:48:05 +0100 Subject: [PATCH 3/6] Sync with latest standards --- .pre-commit-config.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a7e6e3..13a4e98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,10 +60,5 @@ repos: rev: v4.0.0-alpha.8 hooks: - id: prettier - - repo: https://github.com/MartinThoma/check-pip-compile - rev: 0.1.1 - hooks: - - id: check-pip-compile - args: ["."] default_language_version: python: python3.11 From 0b5e994f620a893c42ab5961592aed26dd137444 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 13:35:14 +0100 Subject: [PATCH 4/6] Sync with latest standards --- dependabot.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dependabot.yml diff --git a/dependabot.yml b/dependabot.yml new file mode 100644 index 0000000..6114ed3 --- /dev/null +++ b/dependabot.yml @@ -0,0 +1,22 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7812b7c26b703c5cba3bb235a8e77e1d65cc4c84 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 14:41:54 +0100 Subject: [PATCH 5/6] Sync with latest standards --- .pre-commit-config.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13a4e98..6c9b081 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,9 +56,5 @@ repos: - id: python-no-eval - id: python-no-log-warn - id: rst-backticks - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier default_language_version: - python: python3.11 + python: python3.12 From 172cbde4a6e12b2fd116b206c3183e4806ee06a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 13:46:57 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c9b081..9bf3b64 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,14 +30,8 @@ repos: rev: v1.10.0 hooks: - id: mypy - additional_dependencies: - [ - types-requests, - types-PyYAML, - types-Flask, - types-Werkzeug, - types-Markdown, - ] + additional_dependencies: [types-requests, types-PyYAML, types-Flask, types-Werkzeug, + types-Markdown] - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 hooks: @@ -57,4 +51,4 @@ repos: - id: python-no-log-warn - id: rst-backticks default_language_version: - python: python3.12 + python: python3.11