Skip to content

Commit

Permalink
chore: support update apt packages with renovate (#393)
Browse files Browse the repository at this point in the history
Co-authored-by: Renovate GitHub Bot <[email protected]>
  • Loading branch information
huxuan and Renovate GitHub Bot authored Mar 14, 2024
1 parent 4c48c1c commit b787db0
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ FROM python:${PYTHON_VERSION} as dev
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION

# renovate: depName=debian_12/pipx
ARG PIPX_VERSION="1.1.0-1"
# renovate: depName=debian_12/sudo
ARG SUDO_VERSION="1.9.13p3-1+deb12u1"

RUN apt-get update && apt-get install -y --no-install-recommends \
# pipx: To install Python applications.
pipx \
pipx="${PIPX_VERSION}" \
# sudo: To add sudo support to non-root user.
sudo \
sudo="${SUDO_VERSION}" \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Config pipx
Expand Down
20 changes: 20 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
"pipx install (?<depName>.*?)==(?<currentValue>.*?)[;\n]"
]
},
{
"customType": "regex",
"datasourceTemplate": "repology",
"depTypeTemplate": "apt",
"fileMatch": [
"^\\.devcontainer\\/Dockerfile$",
"^template\\/\\.devcontainer/Dockerfile\\.jinja$"
],
"matchStrings": [
"# renovate: depName=(?<depName>.*?)\nARG .*?_VERSION=\"(?<currentValue>.*)\"\n"
],
"versioningTemplate": "deb"
},
{
"customType": "regex",
"datasourceTemplate": "git-tags",
Expand Down Expand Up @@ -93,6 +106,13 @@
},
"semanticCommitScope": "copier-template"
},
{
"description": "Group apt packages to avoid failure when multiple packages are outdated.",
"groupName": "apt packages",
"matchDepTypes": [
"apt"
]
},
{
"description": "Pre-commit 3.5.0 is pinned as the last version supporting Python 3.8.",
"enabled": false,
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"pytest",
"Quickstart",
"renovatebot",
"repology",
"setuptools",
"softprops",
"sphinxcontrib",
Expand Down
9 changes: 7 additions & 2 deletions template/.devcontainer/Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ FROM python:${PYTHON_VERSION} as dev
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION

# renovate: depName=debian_12/pipx
ARG PIPX_VERSION="1.1.0-1"
# renovate: depName=debian_12/sudo
ARG SUDO_VERSION="1.9.13p3-1+deb12u1"

RUN apt-get update && apt-get install -y --no-install-recommends \
# pipx: To install Python applications.
pipx \
pipx="${PIPX_VERSION}" \
# sudo: To add sudo support to non-root user.
sudo \
sudo="${SUDO_VERSION}" \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Config pipx
Expand Down
22 changes: 22 additions & 0 deletions template/.renovaterc.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@
"pipx install (?<depName>.*?)==(?<currentValue>.*?)[;\n]"
]
},
{
"customType": "regex",
"datasourceTemplate": "repology",
"depTypeTemplate": "apt",
"fileMatch": [
"^\\.devcontainer\\/Dockerfile$"
[%- if project_name == "Serious Scaffold Python" %],
"^template\\/\\.devcontainer/Dockerfile\\.jinja$"
[%- endif %]
],
"matchStrings": [
"# renovate: depName=(?<depName>.*?)\nARG .*?_VERSION=\"(?<currentValue>.*)\"\n"
],
"versioningTemplate": "deb"
},
{
"customType": "regex",
"datasourceTemplate": "git-tags",
Expand Down Expand Up @@ -100,6 +115,13 @@
},
"semanticCommitScope": "copier-template"
},
{
"description": "Group apt packages to avoid failure when multiple packages are outdated.",
"groupName": "apt packages",
"matchDepTypes": [
"apt"
]
},
{
"description": "Pre-commit 3.5.0 is pinned as the last version supporting Python 3.8.",
"enabled": false,
Expand Down
1 change: 1 addition & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"pytest",
"Quickstart",
"renovatebot",
"repology",
"setuptools",
"softprops",
"sphinxcontrib",
Expand Down

0 comments on commit b787db0

Please sign in to comment.