From e22facdcf497a420b820a26383c5f4e980ec9b32 Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 10:17:08 +0800 Subject: [PATCH 1/7] chore: configure constraints in renovate --- .github/workflows/renovate.yml | 8 ++++---- .gitlab/workflows/renovate.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 69679861..db506567 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -8,12 +8,12 @@ jobs: RENOVATE_BRANCH_PREFIX: renovate-github/ RENOVATE_ENABLED: ${{ vars.RENOVATE_ENABLED || true }} RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "gitlabci", "regex", "pre-commit"]' - RENOVATE_OPTIMIZE_FOR_DISABLED: "true" + RENOVATE_OPTIMIZE_FOR_DISABLED: 'true' RENOVATE_PLATFORM: github RENOVATE_REPOSITORIES: '["${{ github.repository }}"]' RENOVATE_REPOSITORY_CACHE: enabled - image: ghcr.io/renovatebot/renovate:37.368.8-full@sha256:ec42750b18504058611851753fb5822522c1999a39476eefc083be70f179a74e - options: "--user root" + image: ghcr.io/renovatebot/renovate:37.368.8 + options: '--user root' runs-on: ubuntu-22.04 steps: - run: env | sort @@ -48,5 +48,5 @@ jobs: on: schedule: # * is a special character in YAML so you have to quote this string - - cron: "*/15 0-3 * * 1" + - cron: '*/15 0-3 * * 1' workflow_dispatch: null diff --git a/.gitlab/workflows/renovate.yml b/.gitlab/workflows/renovate.yml index 002d2702..51be3742 100644 --- a/.gitlab/workflows/renovate.yml +++ b/.gitlab/workflows/renovate.yml @@ -3,7 +3,7 @@ renovate: key: ${CI_COMMIT_REF_SLUG}-renovate paths: - renovate/cache/renovate/repository/ - image: renovate/renovate:37.368.8-full@sha256:ec42750b18504058611851753fb5822522c1999a39476eefc083be70f179a74e + image: renovate/renovate:37.368.8 rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $PAT != null script: renovate $RENOVATE_EXTRA_FLAG From 41d45591bd1b58a7f5fd0dad440142cae94640ec Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 10:17:40 +0800 Subject: [PATCH 2/7] update template --- .../workflows/renovate.yml.jinja | 8 ++++---- .../workflows/renovate.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja index dcd9ee00..ae3fbeb1 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja @@ -12,12 +12,12 @@ jobs: [%- else %] RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "regex", "pre-commit"]' [%- endif %] - RENOVATE_OPTIMIZE_FOR_DISABLED: "true" + RENOVATE_OPTIMIZE_FOR_DISABLED: 'true' RENOVATE_PLATFORM: github RENOVATE_REPOSITORIES: '["{{ '${{ github.repository }}' }}"]' RENOVATE_REPOSITORY_CACHE: enabled - image: ghcr.io/renovatebot/renovate:37.368.8-full@sha256:ec42750b18504058611851753fb5822522c1999a39476eefc083be70f179a74e - options: "--user root" + image: ghcr.io/renovatebot/renovate:37.368.8 + options: '--user root' runs-on: ubuntu-22.04 steps: - run: env | sort @@ -52,5 +52,5 @@ jobs: on: schedule: # * is a special character in YAML so you have to quote this string - - cron: "*/15 0-3 * * 1" + - cron: '*/15 0-3 * * 1' workflow_dispatch: null diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml index 002d2702..51be3742 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml +++ b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml @@ -3,7 +3,7 @@ renovate: key: ${CI_COMMIT_REF_SLUG}-renovate paths: - renovate/cache/renovate/repository/ - image: renovate/renovate:37.368.8-full@sha256:ec42750b18504058611851753fb5822522c1999a39476eefc083be70f179a74e + image: renovate/renovate:37.368.8 rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $PAT != null script: renovate $RENOVATE_EXTRA_FLAG From be6a7fcbfdbec031c482d767f32c8a2d975df885 Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 14:17:06 +0800 Subject: [PATCH 3/7] add renovate constraints --- .renovaterc.json | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index 17486a9f..466fd56b 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -1,5 +1,9 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "constraints": { + "pdm": "2.15.2", + "python": "3.12" + }, "customManagers": [ { "customType": "regex", @@ -44,8 +48,8 @@ }, { "customType": "regex", - "datasourceTemplate": "github-tags", - "depNameTemplate": "pdm-project/pdm", + "datasourceTemplate": "pypi", + "depNameTemplate": "pdm", "description": "Match pdm version specified in setup-pdm GitHub Action", "fileMatch": [ "^\\.github/workflows/.+\\.yml$", @@ -53,8 +57,20 @@ ], "matchStrings": [ "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\n" + ] + }, + { + "customType": "regex", + "datasourceTemplate": "pypi", + "depNameTemplate": "pdm", + "description": "Match pdm version specified in renovate constraints", + "fileMatch": [ + "^\\.renovaterc\\.json$", + "^template/\\.renovaterc\\.json\\.jinja$" ], - "versioningTemplate": "semver" + "matchStrings": [ + "\"pdm\": \"(?.*)\"" + ] }, { "customType": "regex", @@ -196,8 +212,7 @@ "pypi" ], "matchDepNames": [ - "pdm", - "pdm-project/pdm" + "pdm" ] }, { From 37a57c8e431c85147e6f75ab974c0d19ce2de731 Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 14:17:54 +0800 Subject: [PATCH 4/7] update template --- template/.renovaterc.json.jinja | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 506e8040..50093268 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -1,6 +1,10 @@ [% from pathjoin("includes", "version_compare.jinja") import version_higher_than -%] { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "constraints": { + "pdm": "2.15.2", + "python": "{{ default_py }}" + }, "customManagers": [ { "customType": "regex", @@ -49,8 +53,8 @@ }, { "customType": "regex", - "datasourceTemplate": "github-tags", - "depNameTemplate": "pdm-project/pdm", + "datasourceTemplate": "pypi", + "depNameTemplate": "pdm", "description": "Match pdm version specified in setup-pdm GitHub Action", "fileMatch": [ "^\\.github/workflows/.+\\.yml$" @@ -60,8 +64,22 @@ ], "matchStrings": [ "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\n" + ] + }, + { + "customType": "regex", + "datasourceTemplate": "pypi", + "depNameTemplate": "pdm", + "description": "Match pdm version specified in renovate constraints", + "fileMatch": [ + "^\\.renovaterc\\.json$" +[%- if project_name == "Serious Scaffold Python" %], + "^template/\\.renovaterc\\.json\\.jinja$" +[%- endif %] ], - "versioningTemplate": "semver" + "matchStrings": [ + "\"pdm\": \"(?.*)\"" + ] }, { "customType": "regex", @@ -209,8 +227,7 @@ "pypi" ], "matchDepNames": [ - "pdm", - "pdm-project/pdm" + "pdm" ] }, { From c659c2c773580517e09a9018265ef872174c6e7a Mon Sep 17 00:00:00 2001 From: "huxuan-assistant[bot]" <163485190+huxuan-assistant[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 14:37:45 +0800 Subject: [PATCH 5/7] build(deps): update renovate to v37.374.3 (#109) Co-authored-by: huxuan-assistant[bot] <163485190+huxuan-assistant[bot]@users.noreply.github.com> --- .github/workflows/renovate.yml | 2 +- .gitlab/workflows/renovate.yml | 2 +- .pre-commit-config.yaml | 2 +- template/.pre-commit-config.yaml.jinja | 2 +- .../workflows/renovate.yml.jinja | 2 +- .../workflows/renovate.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index db506567..c682340a 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -12,7 +12,7 @@ jobs: RENOVATE_PLATFORM: github RENOVATE_REPOSITORIES: '["${{ github.repository }}"]' RENOVATE_REPOSITORY_CACHE: enabled - image: ghcr.io/renovatebot/renovate:37.368.8 + image: ghcr.io/renovatebot/renovate:37.374.3@sha256:a12297dde4fad3d54111c3e4471aae726e7bc99bd407b74886394c41bc227250 options: '--user root' runs-on: ubuntu-22.04 steps: diff --git a/.gitlab/workflows/renovate.yml b/.gitlab/workflows/renovate.yml index 51be3742..255e1927 100644 --- a/.gitlab/workflows/renovate.yml +++ b/.gitlab/workflows/renovate.yml @@ -3,7 +3,7 @@ renovate: key: ${CI_COMMIT_REF_SLUG}-renovate paths: - renovate/cache/renovate/repository/ - image: renovate/renovate:37.368.8 + image: renovate/renovate:37.374.3@sha256:a12297dde4fad3d54111c3e4471aae726e7bc99bd407b74886394c41bc227250 rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $PAT != null script: renovate $RENOVATE_EXTRA_FLAG diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db06bee3..013b64be 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: files: .pre-commit-config.yaml - id: trailing-whitespace - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 37.368.8 + rev: 37.374.3 hooks: - id: renovate-config-validator - repo: local diff --git a/template/.pre-commit-config.yaml.jinja b/template/.pre-commit-config.yaml.jinja index b8eff78e..1db43972 100644 --- a/template/.pre-commit-config.yaml.jinja +++ b/template/.pre-commit-config.yaml.jinja @@ -29,7 +29,7 @@ repos: files: .pre-commit-config.yaml - id: trailing-whitespace - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 37.368.8 + rev: 37.374.3 hooks: - id: renovate-config-validator - repo: local diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja index ae3fbeb1..12e0eef4 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja +++ b/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja @@ -16,7 +16,7 @@ jobs: RENOVATE_PLATFORM: github RENOVATE_REPOSITORIES: '["{{ '${{ github.repository }}' }}"]' RENOVATE_REPOSITORY_CACHE: enabled - image: ghcr.io/renovatebot/renovate:37.368.8 + image: ghcr.io/renovatebot/renovate:37.374.3@sha256:a12297dde4fad3d54111c3e4471aae726e7bc99bd407b74886394c41bc227250 options: '--user root' runs-on: ubuntu-22.04 steps: diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml index 51be3742..255e1927 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml +++ b/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml @@ -3,7 +3,7 @@ renovate: key: ${CI_COMMIT_REF_SLUG}-renovate paths: - renovate/cache/renovate/repository/ - image: renovate/renovate:37.368.8 + image: renovate/renovate:37.374.3@sha256:a12297dde4fad3d54111c3e4471aae726e7bc99bd407b74886394c41bc227250 rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $PAT != null script: renovate $RENOVATE_EXTRA_FLAG From d16cba14e15089684eec499840a3ba39716797ed Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 15:27:27 +0800 Subject: [PATCH 6/7] try a different python constraint --- .renovaterc.json | 2 +- template/.renovaterc.json.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index 466fd56b..e8315ef0 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -2,7 +2,7 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "constraints": { "pdm": "2.15.2", - "python": "3.12" + "python": "==3.12" }, "customManagers": [ { diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 50093268..07e16988 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -3,7 +3,7 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "constraints": { "pdm": "2.15.2", - "python": "{{ default_py }}" + "python": "=={{ default_py }}" }, "customManagers": [ { From 535fffcbaa595aa3bf139f72a084c63e09e6a8ff Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 23 May 2024 15:47:31 +0800 Subject: [PATCH 7/7] update documentation --- .renovaterc.json | 2 +- docs/management/update.md | 1 + template/.renovaterc.json.jinja | 2 +- template/docs/management/update.md | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index e8315ef0..6fafd39e 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -63,7 +63,7 @@ "customType": "regex", "datasourceTemplate": "pypi", "depNameTemplate": "pdm", - "description": "Match pdm version specified in renovate constraints", + "description": "Match pdm version specified in the renovate constraints", "fileMatch": [ "^\\.renovaterc\\.json$", "^template/\\.renovaterc\\.json\\.jinja$" diff --git a/docs/management/update.md b/docs/management/update.md index 9404aba0..d0e976e6 100644 --- a/docs/management/update.md +++ b/docs/management/update.md @@ -29,6 +29,7 @@ The project template tracks the following dependencies: 1. Python packages installed with pip, pipx and asdf, listed in the README, DevContainer Dockerfile, GitHub Actions, GitLab CI/CD, ReadTheDocs configuration, Renovate configuration and documentation. 1. Debian packages installed in the DevContainer Dockerfile. 1. PDM version specified in the `pdm-project/setup-pdm` GitHub action. + 1. PDM version specified in the renovate constraints. 1. NPM packages used with npx. 1. The project template itself. diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 07e16988..4b4d40ba 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -70,7 +70,7 @@ "customType": "regex", "datasourceTemplate": "pypi", "depNameTemplate": "pdm", - "description": "Match pdm version specified in renovate constraints", + "description": "Match pdm version specified in the renovate constraints", "fileMatch": [ "^\\.renovaterc\\.json$" [%- if project_name == "Serious Scaffold Python" %], diff --git a/template/docs/management/update.md b/template/docs/management/update.md index 9404aba0..d0e976e6 100644 --- a/template/docs/management/update.md +++ b/template/docs/management/update.md @@ -29,6 +29,7 @@ The project template tracks the following dependencies: 1. Python packages installed with pip, pipx and asdf, listed in the README, DevContainer Dockerfile, GitHub Actions, GitLab CI/CD, ReadTheDocs configuration, Renovate configuration and documentation. 1. Debian packages installed in the DevContainer Dockerfile. 1. PDM version specified in the `pdm-project/setup-pdm` GitHub action. + 1. PDM version specified in the renovate constraints. 1. NPM packages used with npx. 1. The project template itself.