Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ ARG PYTHON_VERSION=3.12

FROM python:${PYTHON_VERSION} as dev

# NOTE: python docker image has env `PYTHON_VERSION` but with patch version.
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION

RUN apt-get update && apt-get install -y --no-install-recommends \
# pipx: To install Python applications.
pipx \
Expand All @@ -22,7 +26,11 @@ 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 if [ "${PYTHON_VERSION}" = "3.8" ]; then \
pipx install pre-commit==3.5.0; \
else \
pipx install pre-commit==3.6.2; \
fi

# Create a non-root user with sudo permission
ARG USERNAME=ss-python
Expand Down Expand Up @@ -60,7 +68,7 @@ FROM python:${PYTHON_VERSION}-slim as prod

# NOTE: python docker image has env `PYTHON_VERSION` but with patch version.
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION=3.12
ARG PYTHON_VERSION

# Retrieve packages from build stage.
ENV PYTHONPATH=/workspace/pkgs
Expand Down
10 changes: 9 additions & 1 deletion .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"^template\\/\\.devcontainer/Dockerfile\\.jinja$"
],
"matchStrings": [
"RUN pipx install (?<depName>.*?)==(?<currentValue>.*?)\n"
"pipx install (?<depName>.*?)==(?<currentValue>.*?)[;\n]"
]
},
{
Expand Down Expand Up @@ -59,6 +59,14 @@
]
},
"semanticCommitScope": "copier-template"
},
{
"description": "Pre-commit 3.5.0 is pinned as the last version supporting Python 3.8.",
"enabled": false,
"matchCurrentVersion": "==3.5.0",
"matchPackageNames": [
"pre-commit"
]
}
]
}
12 changes: 10 additions & 2 deletions template/.devcontainer/Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ ARG PYTHON_VERSION={{ default_py }}

FROM python:${PYTHON_VERSION} as dev

# NOTE: python docker image has env `PYTHON_VERSION` but with patch version.
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION

RUN apt-get update && apt-get install -y --no-install-recommends \
# pipx: To install Python applications.
pipx \
Expand All @@ -22,7 +26,11 @@ 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 if [ "${PYTHON_VERSION}" = "3.8" ]; then \
pipx install pre-commit==3.5.0; \
else \
pipx install pre-commit==3.6.2; \
fi

# Create a non-root user with sudo permission
ARG USERNAME={{ repo_name }}
Expand Down Expand Up @@ -60,7 +68,7 @@ FROM python:${PYTHON_VERSION}-slim as prod

# NOTE: python docker image has env `PYTHON_VERSION` but with patch version.
# ARG is used here for temporary override without changing the original env.
ARG PYTHON_VERSION={{ default_py }}
ARG PYTHON_VERSION

# Retrieve packages from build stage.
ENV PYTHONPATH=/workspace/pkgs
Expand Down
11 changes: 10 additions & 1 deletion template/.renovaterc.json.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[% from pathjoin("includes", "version_compare.jinja") import version_higher_than -%]
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
Expand All @@ -11,7 +12,7 @@
[%- endif %]
],
"matchStrings": [
"RUN pipx install (?<depName>.*?)==(?<currentValue>.*?)\n"
"pipx install (?<depName>.*?)==(?<currentValue>.*?)[;\n]"
]
},
{
Expand Down Expand Up @@ -65,6 +66,14 @@
]
},
"semanticCommitScope": "copier-template"
},
{
"description": "Pre-commit 3.5.0 is pinned as the last version supporting Python 3.8.",
"enabled": false,
"matchCurrentVersion": "==3.5.0",
"matchPackageNames": [
"pre-commit"
]
}
]
}