From 3b15285d0702d7e031d0f26ee31d1cb4eacab9cd Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Tue, 22 Oct 2024 09:29:35 -0700 Subject: [PATCH] Install LTS node during reusable testing workflow (#152) * ci: Remove broken pre-commit hook * ci: Update tox config to use a more robust poetry install command * chore(pre-commit-deps): Update pre-commit hooks * feat: Update test code workflow to install the latest LTS node version * ci: Update pre-commit hook config * ci: Update pre-commit hook config * ci: Update pre-commit hook config --- .github/workflows/_reusable-test-code.yml | 6 ++++++ .pre-commit-config.yaml | 21 ++++++++++++--------- pyproject.toml | 4 ++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/_reusable-test-code.yml b/.github/workflows/_reusable-test-code.yml index e9923f2a..7be79dca 100644 --- a/.github/workflows/_reusable-test-code.yml +++ b/.github/workflows/_reusable-test-code.yml @@ -43,6 +43,9 @@ jobs: steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + with: + node-version: lts/* + check-latest: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 with: @@ -79,6 +82,9 @@ jobs: steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + with: + node-version: lts/* + check-latest: true - name: Set up Python uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01710de6..036f9b0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ ci: - pyright - poetry-audit - markdown-link-check + - renovate-config-validator # TODO: remove this line once https://github.com/renovatebot/pre-commit-hooks/issues/2460 is resolved repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 @@ -39,11 +40,12 @@ repos: - id: remove-tabs - id: forbid-tabs - repo: https://github.com/renovatebot/pre-commit-hooks - rev: bd345f6e0f1a132a6c4c148c56c64c6b07a716ee # frozen: 38.110.3 + rev: 95f517843e74d0556552029591a77b01bd40cd4d # frozen: 38.129.2 hooks: - id: renovate-config-validator + language_version: 20.18.0 # TODO: remove this line once https://github.com/renovatebot/pre-commit-hooks/issues/2460 is resolved - repo: https://github.com/python-jsonschema/check-jsonschema - rev: aa1acdb72677dfbc5f507d2dfd45d8380bbcc2e0 # frozen: 0.29.3 + rev: 37cd56d9d154dfb0648eaee8efc1040512700c47 # frozen: 0.29.4 hooks: - id: check-dependabot - id: check-github-actions @@ -78,7 +80,7 @@ repos: - id: hadolint args: [--ignore=DL3008, --ignore=DL3018] - repo: https://github.com/executablebooks/mdformat - rev: 08fba30538869a440b5059de90af03e3502e35fb # frozen: 0.7.17 + rev: 86542e37a3a40974eb812b16b076220fe9bb4278 # frozen: 0.7.18 hooks: - id: mdformat args: [--number, --end-of-line, keep] @@ -135,13 +137,14 @@ repos: always_run: true args: [audit, --json, --ignore-code=CVE-2019-8341] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 75b98813cfb7e663870a28c74366a1e99d7bfe79 # frozen: v0.6.9 + rev: 8983acb92ee4b01924893632cf90af926fa608f0 # frozen: v0.7.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - - repo: https://github.com/PyCQA/docformatter - rev: dfefe062799848234b4cd60b04aa633c0608025e # frozen: v1.7.5 - hooks: - - id: docformatter - additional_dependencies: [tomli] + # TODO: Re-enable this once https://github.com/PyCQA/docformatter/issues/293 is resolved + # - repo: https://github.com/PyCQA/docformatter + # rev: dfefe062799848234b4cd60b04aa633c0608025e # frozen: v1.7.5 + # hooks: + # - id: docformatter + # additional_dependencies: [tomli] diff --git a/pyproject.toml b/pyproject.toml index bae3f1e9..0c043166 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -279,7 +279,7 @@ setenv = # Skip pre-commit checks that are not needed SKIP = file-contents-sorter commands_pre = - poetry install + python -m poetry install commands = !tests: pre-commit run --all-files pytest -vv -k "not test_docs" --showlocals --cov --junitxml={tox_root}/.results_{envname}/results.xml --cov-report=term --cov-report=xml:{tox_root}/.coverage_{envname}.xml --cov-report=html:{tox_root}/.results_{envname}/html --self-contained-html --html={tox_root}/.results_{envname}/results.html @@ -295,7 +295,7 @@ setenv = [testenv:docs] commands_pre = - poetry install --only docs + python -m poetry install --only docs commands = python -c "import shutil; shutil.rmtree('.results_{envname}', ignore_errors=True)" mkdocs --verbose build --site-dir .results_{envname}