From 6e90c05c371de6a2e326cfdb2343a4969b494006 Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Wed, 6 Mar 2024 11:17:12 +0800 Subject: [PATCH 1/2] chore: fix Python 3.8 compatibility issue --- .devcontainer/Dockerfile | 2 +- .renovaterc.json | 7 +++++++ template/.devcontainer/Dockerfile.jinja | 5 +++++ template/.renovaterc.json.jinja | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 971d8b2a..abb642e1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -22,7 +22,7 @@ ENV PIPX_DEFAULT_PYTHON=/usr/local/bin/python RUN pipx install pdm==2.12.4 # Install pre-commit -RUN pipx install pre-commit==3.6.2 +RUN pipx install pre-commit==3.5.0 # Create a non-root user with sudo permission ARG USERNAME=ss-python diff --git a/.renovaterc.json b/.renovaterc.json index ef051cfe..b8fd925c 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -49,6 +49,13 @@ ] }, "semanticCommitScope": "copier-template" + }, + { + "enabled": false, + "matchCurrentVersion": "3.5.0", + "matchPackageNames": [ + "pre-commit" + ] } ] } diff --git a/template/.devcontainer/Dockerfile.jinja b/template/.devcontainer/Dockerfile.jinja index 08d4fc48..1008dab3 100644 --- a/template/.devcontainer/Dockerfile.jinja +++ b/template/.devcontainer/Dockerfile.jinja @@ -1,3 +1,4 @@ +[% from pathjoin("includes", "version_compare.jinja") import version_higher_than -%] ARG PYTHON_VERSION={{ default_py }} ######################################################################################## @@ -22,7 +23,11 @@ ENV PIPX_DEFAULT_PYTHON=/usr/local/bin/python RUN pipx install pdm==2.12.4 # Install pre-commit +[%- if not version_higher_than(min_py, "3.9") %] +RUN pipx install pre-commit==3.5.0 +[%- else %] RUN pipx install pre-commit==3.6.2 +[%- endif %] # Create a non-root user with sudo permission ARG USERNAME={{ repo_name }} diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 4e099596..a4767161 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -1,3 +1,4 @@ +[% from pathjoin("includes", "version_compare.jinja") import version_higher_than -%] { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "customManagers": [ @@ -54,5 +55,14 @@ }, "semanticCommitScope": "copier-template" } +[%- if not version_higher_than(min_py, "3.9") %], + { + "enabled": false, + "matchCurrentVersion": "3.5.0", + "matchPackageNames": [ + "pre-commit" + ] + } +[%- endif %] ] } From 542bf0246114d5470e3625d16771a94c3457bc34 Mon Sep 17 00:00:00 2001 From: Renovate GitHub Bot Date: Wed, 6 Mar 2024 04:06:01 +0000 Subject: [PATCH 2/2] chore(deps): update dependency pre-commit to v3.6.2 --- .devcontainer/Dockerfile | 2 +- template/.devcontainer/Dockerfile.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index abb642e1..971d8b2a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -22,7 +22,7 @@ ENV PIPX_DEFAULT_PYTHON=/usr/local/bin/python RUN pipx install pdm==2.12.4 # Install pre-commit -RUN pipx install pre-commit==3.5.0 +RUN pipx install pre-commit==3.6.2 # Create a non-root user with sudo permission ARG USERNAME=ss-python diff --git a/template/.devcontainer/Dockerfile.jinja b/template/.devcontainer/Dockerfile.jinja index 1008dab3..02ae7f33 100644 --- a/template/.devcontainer/Dockerfile.jinja +++ b/template/.devcontainer/Dockerfile.jinja @@ -24,7 +24,7 @@ RUN pipx install pdm==2.12.4 # Install pre-commit [%- if not version_higher_than(min_py, "3.9") %] -RUN pipx install pre-commit==3.5.0 +RUN pipx install pre-commit==3.6.2 [%- else %] RUN pipx install pre-commit==3.6.2 [%- endif %]