Skip to content

Commit 60c3a85

Browse files
Update template files (#114)
* Update template files * Tweak test param to mitigate flaky behavior * Remove python 3.9 references and add python 3.13 * Modernize code and upgrade lock files again * Modify versions in tests dot yaml * Remove unused docker compose arg * Fix tox config * Switch some values back to match template and hexkit's CI test matrix * Fix accidental gh action downgrade * Install second python version in dev container to run tox locally
1 parent 20ba6b2 commit 60c3a85

35 files changed

+1102
-947
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9-bullseye
1+
FROM mcr.microsoft.com/devcontainers/python:2.0.2-3.13-trixie
22

3-
ENV PYTHONUNBUFFERED 1
3+
ENV PYTHONUNBUFFERED=1
44

55
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
66
ARG USER_UID=1000
77
ARG USER_GID=$USER_UID
88
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi
99

10-
# [Option] Install Node.js
11-
ARG INSTALL_NODE="false"
12-
ARG NODE_VERSION="lts/*"
13-
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
14-
15-
# Copy install and launcher script to bin:
10+
# Copy install script
1611
COPY ./dev_install /bin
17-
COPY ./dev_launcher /bin
12+
13+
# Install secondary Python version
14+
USER vscode
15+
RUN <<EOF
16+
curl -sS https://pyenv.run | /bin/sh
17+
INIT_PYENV='
18+
export PYENV_ROOT="$HOME/.pyenv"
19+
[ -d "$PYENV_ROOT/bin" ] && export PATH="$PYENV_ROOT/bin:$PATH"
20+
eval "$(pyenv init -)"
21+
'
22+
echo "$INIT_PYENV" >> ~/.profile
23+
echo "$INIT_PYENV" >> ~/.bashrc
24+
. ~/.profile
25+
pyenv install --skip-existing 3.10
26+
pyenv global system 3.10
27+
EOF
1828

1929
CMD ["sleep", "infinity"]

.devcontainer/dev_launcher

Lines changed: 0 additions & 2 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@
7070
},
7171
"features": {
7272
// details can be found here: https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker
73-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
73+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {"moby": false}
7474
}
7575
}

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ services:
66
context: .
77
dockerfile: ./Dockerfile
88
args:
9-
# [Choice] Python version: 3, 3.8, 3.7, 3.6
10-
VARIANT: 3.9
119
# [Choice] Install Node.js
1210
INSTALL_NODE: "true"
1311
NODE_VERSION: "lts/*"

.github/workflows/check_config_docs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check config docs
2123
id: check-config-docs

.github/workflows/check_pyproject.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check pyproject.toml
2123
id: check-pyproject

.github/workflows/check_readme.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check README
2123
id: check-readme

.github/workflows/check_template_files.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

16-
- name: Set up Python 3.12
16+
- name: Set up Python 3.13
1717
id: setup-python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
20-
python-version: '3.12'
20+
python-version: '3.13'
2121

2222
- name: Check template files
2323
id: check-template-files

.github/workflows/static_code_analysis.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Run pre-commit
2123
uses: pre-commit/[email protected]

.github/workflows/tests.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
strategy:
12-
fail-fast: false
1312
matrix:
14-
python-version: ['3.9', '3.10', '3.11', '3.12']
13+
python-version: ['3.10', '3.11', '3.12', '3.13']
1514

1615
steps:
1716
- name: Checkout repository
1817
id: checkout
19-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
2019

2120
- name: Common steps
2221
id: common
@@ -27,19 +26,19 @@ jobs:
2726
- name: Install tox plugin
2827
id: install-tox-gh-actions
2928
run: |
30-
pip install --disable-pip-version-check "tox-gh-actions>=3.2,<4"
29+
pip install --disable-pip-version-check "tox-gh-actions>=3.3,<4"
3130
3231
- name: Run tests with Python ${{ matrix.python-version }}
3332
id: pytest
34-
if: ${{ matrix.python-version != '3.12' }}
33+
if: ${{ matrix.python-version != '3.13' }}
3534
run: |
3635
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
3736
3837
tox
3938
4039
- name: Run tests with Python ${{ matrix.python-version }} measuring coverage
4140
id: pytest-coverage
42-
if: ${{ matrix.python-version == '3.12' }}
41+
if: ${{ matrix.python-version == '3.13' }}
4342
run: |
4443
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
4544
@@ -48,7 +47,7 @@ jobs:
4847
4948
- name: Upload coverage to coveralls
5049
id: coveralls
51-
if: ${{ matrix.python-version == '3.12' }}
50+
if: ${{ matrix.python-version == '3.13' }}
5251
env:
5352
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5453
run: |

0 commit comments

Comments
 (0)