From ff041420009a54ddf213c33c1ee10ecd224ea912 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 01:37:49 +0100 Subject: [PATCH 1/7] Sync with latest standards --- .pre-commit-config.yaml | 60 +++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a801c36..3a7e6e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ -exclude: '^$|venv' +exclude: "^$|venv|.obsidian" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,27 +11,59 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 24.4.2 hooks: - id: black - language_version: python3.9 - - 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-all-unused-imports', '--remove-unused-variable' ] + args: [--remove-all-unused-imports, --in-place] - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.13.2 hooks: - id: isort - args: ['--line-length=79'] - language_version: python3.9 + args: ["--profile", "black", "--filter-files", "--line-length=79"] + language_version: python3.12 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + 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: v2.34.0 + rev: v3.15.2 hooks: - - id: pyupgrade - args: [--py36-plus] + - id: pyupgrade + args: + - --py38-plus + - repo: https://github.com/andreoliwa/nitpick + rev: v0.35.0 + hooks: + - id: nitpick + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-check-blanket-noqa + - id: python-check-mock-methods + - 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 522ca731ecb0061b02716e00034cad27014c0637 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 12:25:43 +0100 Subject: [PATCH 2/7] Sync with latest standards --- nitpick-style.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 nitpick-style.toml diff --git a/nitpick-style.toml b/nitpick-style.toml new file mode 100644 index 0000000..0bbf053 --- /dev/null +++ b/nitpick-style.toml @@ -0,0 +1,4 @@ +[nitpick.styles] +include = [ + "py://nitpick/resources/python/pre-commit-hooks", +] From 503c0f700a05f7dcc3caad5639a93a11da123a55 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 12:48:05 +0100 Subject: [PATCH 3/7] 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 4e69febed8a6eda03362cef9c094fc1e3e89d166 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 12:26:54 +0000 Subject: [PATCH 4/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/python.yml | 67 ++++++++++++++++++------------------ fixtures/dennis.html | 24 +++++++------ fixtures/fiona.html | 24 +++++++------ fixtures/results.html | 28 ++++++++------- fixtures/users.html | 54 +++++++++++++++-------------- 5 files changed, 105 insertions(+), 92 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index bf71efb..ee236e0 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.6, 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - uses: actions/cache@v2 - 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.9 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: | - python setup.py bdist - - name: Publish package - if: matrix.python-version == 3.9 && 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@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v2 + 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.9 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: | + python setup.py bdist + - name: Publish package + if: matrix.python-version == 3.9 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/fixtures/dennis.html b/fixtures/dennis.html index 9d50bbf..62150be 100644 --- a/fixtures/dennis.html +++ b/fixtures/dennis.html @@ -1,12 +1,16 @@ - + - - User: Dennis - - -

This page is about a fictional person with the following attributes:

-
    -
  • His name is Dennis Felt
  • -
- + + User: Dennis + + +

This page is about a fictional person with the following attributes:

+
    +
  • His name is Dennis Felt
  • +
+ diff --git a/fixtures/fiona.html b/fixtures/fiona.html index 80b9d52..421836e 100644 --- a/fixtures/fiona.html +++ b/fixtures/fiona.html @@ -1,12 +1,16 @@ - + - - User: Fiona - - -

This page is about a fictional person with the following attributes:

-
    -
  • Her name is Fiona Bennett
  • -
- + + User: Fiona + + +

This page is about a fictional person with the following attributes:

+
    +
  • Her name is Fiona Bennett
  • +
+ diff --git a/fixtures/results.html b/fixtures/results.html index 304bc96..44b8c45 100644 --- a/fixtures/results.html +++ b/fixtures/results.html @@ -1,16 +1,18 @@ - + - - List of Users - - -

Search Results

-

- This is a fictional page for possible response for a user search. -

-
    -
  1. Fiona Bennett
  2. -
+ + List of Users + + +

Search Results

+

This is a fictional page for possible response for a user search.

+
    +
  1. + Fiona Bennett +
  2. +
Return Home - + diff --git a/fixtures/users.html b/fixtures/users.html index b85b048..b001464 100644 --- a/fixtures/users.html +++ b/fixtures/users.html @@ -1,28 +1,32 @@ - + - - List of Users - - -

List of Users

-

- This is a fictional page for an API that allows browsing, adding and - editing users. -

-

Add new user

-
- - -
-

Search for user

-
- - -
-

View user

- + + List of Users + + +

List of Users

+

+ This is a fictional page for an API that allows browsing, adding and + editing users. +

+

Add new user

+
+ + +
+

Search for user

+
+ + +
+

View user

+ Return Home - + From 766343c961b14cc0dc1e4ad768f2cea06dd92b18 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 13:35:15 +0100 Subject: [PATCH 5/7] 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 b8c89dc56fe222a808bcac7ae0e750849887893d Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 14:41:54 +0100 Subject: [PATCH 6/7] 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 04bf6d809c8bea1429148644b9b177b3fad5cdc3 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:43:12 +0000 Subject: [PATCH 7/7] [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