Skip to content

Commit 95b8b33

Browse files
authored
Fix CI and update to latest Ubuntu/Python versions (#454)
1 parent 7f701d5 commit 95b8b33

14 files changed

+1416
-1306
lines changed

.devcontainer/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Development Environment
22

33
These VSCode devcontainers setup multiple environments for testing against
4-
different python versins.
4+
different python versions.
55

66
## Setup
77

.devcontainer/devcontainer.json

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
2-
"name": "py_trees-38",
2+
"name": "py_trees-310",
33

44
"build": {
55
"dockerfile": "./Dockerfile",
66
"args": {
7-
"NAME": "py_trees",
8-
"POETRY_VERSION": "1.3.2",
9-
"PYTHON_VERSION": "3.8.16",
7+
"NAME": "py_trees-310",
8+
"POETRY_VERSION": "1.8.4",
9+
"PYTHON_VERSION": "3.10.15",
1010
"DEBIAN_VERSION": "bullseye"
11-
},
12-
"context": ".."
11+
}
1312
},
1413
"containerEnv": {
1514
"POETRY_HTTP_BASIC_PYPI_USERNAME": "${localEnv:POETRY_HTTP_BASIC_PYPI_USERNAME}",
@@ -20,19 +19,15 @@
2019
"vscode": {
2120
"extensions": [
2221
"bierner.github-markdown-preview",
23-
"bierner.markdown-preview-github-styles",
2422
"bungcip.better-toml",
25-
"eamodio.gitlens",
26-
"ms-python.python",
27-
"omnilib.ufmt",
28-
"redhat.vscode-yaml",
2923
"streetsidesoftware.code-spell-checker",
30-
"tht13.rst-vscode"
24+
"lextudio.restructuredtext",
25+
"ms-python.python",
26+
"omnilib.ufmt"
3127
]
3228
}
3329
},
3430
"postCreateCommand": "poetry install",
35-
// Breaks codespaces
36-
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind",
37-
// "workspaceFolder": "/workspaces"
38-
}
31+
"workspaceMount": "source=${localWorkspaceFolder}/../..,target=/workspaces,type=bind",
32+
"workspaceFolder": "/workspaces"
33+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
2-
"name": "py_trees-310",
2+
"name": "py_trees-312",
33

44
"build": {
55
"dockerfile": "../../Dockerfile",
66
"args": {
7-
"NAME": "py_trees-310",
8-
"POETRY_VERSION": "1.3.2",
9-
"PYTHON_VERSION": "3.10.9",
7+
"NAME": "py_trees-312",
8+
"POETRY_VERSION": "1.8.4",
9+
"PYTHON_VERSION": "3.12.4",
1010
"DEBIAN_VERSION": "bullseye"
11-
}
11+
},
12+
"context": ".."
1213
},
1314
"containerEnv": {
1415
"POETRY_HTTP_BASIC_PYPI_USERNAME": "${localEnv:POETRY_HTTP_BASIC_PYPI_USERNAME}",
@@ -19,15 +20,19 @@
1920
"vscode": {
2021
"extensions": [
2122
"bierner.github-markdown-preview",
23+
"bierner.markdown-preview-github-styles",
2224
"bungcip.better-toml",
23-
"streetsidesoftware.code-spell-checker",
24-
"lextudio.restructuredtext",
25+
"eamodio.gitlens",
2526
"ms-python.python",
26-
"omnilib.ufmt"
27+
"omnilib.ufmt",
28+
"redhat.vscode-yaml",
29+
"streetsidesoftware.code-spell-checker",
30+
"tht13.rst-vscode"
2731
]
2832
}
2933
},
3034
"postCreateCommand": "poetry install",
31-
"workspaceMount": "source=${localWorkspaceFolder}/../..,target=/workspaces,type=bind",
32-
"workspaceFolder": "/workspaces"
33-
}
35+
// Breaks codespaces
36+
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind",
37+
// "workspaceFolder": "/workspaces"
38+
}

.github/workflows/pre-merge.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ on:
1010

1111
jobs:
1212
pre-merge:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
strategy:
1515
matrix:
16-
python-version: ["3.8", "3.10"]
16+
python-version: ["3.10", "3.12"]
1717
include:
18-
- python-version: "3.8"
19-
python-py-version: "py38"
2018
- python-version: "3.10"
2119
python-py-version: "py310"
20+
- python-version: "3.12"
21+
python-py-version: "py312"
2222
container:
2323
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
2424
credentials:
2525
username: ${{ github.actor }}
2626
password: ${{ secrets.GITHUB_TOKEN }}
2727

2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
- name: Poetry Venv Dir
3131
run: |
3232
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV
3333
3434
- name: Restore the Cache
3535
id: cache-deps
36-
uses: actions/cache@v3
36+
uses: actions/cache@v4
3737
with:
3838
path: ${{ env.VENV_DIR }}
3939
# bump the suffix if you need to force-refresh the cache

.github/workflows/push_poetry_container.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ env:
44
REGISTRY: ghcr.io
55
IMAGE_NAME: ${{ github.repository }}-ci
66
POETRY_VERSION: 1.3.2
7-
PYTHON_PRIMARY_VERSION: 3.8.16
8-
PYTHON_PRIMARY_TAG: py38
9-
PYTHON_SECONDARY_VERSION: 3.10.9
10-
PYTHON_SECONDARY_TAG: py310
7+
PYTHON_PRIMARY_VERSION: 3.10.15
8+
PYTHON_PRIMARY_TAG: py310
9+
PYTHON_SECONDARY_VERSION: 3.12.4
10+
PYTHON_SECONDARY_TAG: py312
1111
DEBIAN_VERSION: bullseye
1212

1313
on:
@@ -20,22 +20,22 @@ on:
2020

2121
jobs:
2222
push-poetry-container:
23-
runs-on: ubuntu-22.04
23+
runs-on: ubuntu-24.04
2424
permissions:
2525
contents: read
2626
packages: write
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030
- name: Login to GCR
31-
uses: docker/login-action@v2
31+
uses: docker/login-action@v3
3232
with:
3333
registry: ghcr.io
3434
username: ${{ github.actor }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636
- name: Metadata
3737
id: meta
38-
uses: docker/metadata-action@v4
38+
uses: docker/metadata-action@v5
3939
with:
4040
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4141
- name: Echo
@@ -48,7 +48,7 @@ jobs:
4848
echo "TAGS: ${{ steps.meta.outputs.tags }}"
4949
echo "LABELS: ${{ steps.meta.outputs.labels }}"
5050
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_PRIMARY_VERSION }}
51-
uses: docker/build-push-action@v3
51+
uses: docker/build-push-action@v6
5252
with:
5353
file: ./.devcontainer/Dockerfile
5454
push: true
@@ -61,7 +61,7 @@ jobs:
6161
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ env.PYTHON_PRIMARY_VERSION }}-poetry${{ env.POETRY_VERSION }}-${{ env.DEBIAN_VERSION }}
6262
labels: ${{ steps.meta.outputs.labels }}
6363
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_SECONDARY_VERSION }}
64-
uses: docker/build-push-action@v3
64+
uses: docker/build-push-action@v6
6565
with:
6666
file: ./.devcontainer/Dockerfile
6767
push: true

.github/workflows/update-poetry-cache.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@ on:
1717

1818
jobs:
1919
update-poetry-cache:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121
strategy:
2222
matrix:
23-
python-version: ["3.8", "3.10"]
23+
python-version: ["3.10", "3.12"]
2424
include:
25-
- python-version: "3.8"
26-
python-py-version: "py38"
2725
- python-version: "3.10"
28-
python-py-version: "py310"
26+
python-py-version: "py10"
27+
- python-version: "3.12"
28+
python-py-version: "py312"
2929
container:
3030
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
3131
credentials:
3232
username: ${{ github.actor }}
3333
password: ${{ secrets.GITHUB_TOKEN }}
3434

3535
steps:
36-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3737
- name: Poetry Venv Dir
3838
run: |
3939
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV
4040
4141
- name: Restore the Cache
4242
id: cache-deps
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ${{ env.VENV_DIR }}
4646
# bump the suffix if you need to force-refresh the cache

DEVELOPING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## Test-Format-Lint
77

8-
Check against at least one of py38 / py310 [1].
8+
Check against at least one of py310 / py312 [1].
99

1010
```
1111
# Auto-format your code (if using VSCode, install the ufmt extension)
@@ -15,13 +15,13 @@ $ poetry run tox -e format
1515
$ poetry run tox -e check
1616
1717
# Type-Check
18-
$ poetry run mypy38
18+
$ poetry run mypy310
1919
2020
# Tests
21-
$ poetry run tox -e py38
21+
$ poetry run tox -e py310
2222
```
2323

24-
[1] CI will test against both python versions for you, but should you wish to do so locally, open up two VSCode windows, one with the project opened in the default [py38 devcontainer](.devcontainer) and the other with the [py310 devcontainer](.devcontainer/py310).
24+
[1] CI will test against both python versions for you, but should you wish to do so locally, open up two VSCode windows, one with the project opened in the default [py310 devcontainer](.devcontainer) and the other with the [py312 devcontainer](.devcontainer/py312).
2525

2626
## Documentation
2727

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ You can get started on CodeSpaces (with no mismatched environment issues and in
3939
4040
# Explore the demos
4141
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell
42-
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-<tab>-<tab>
42+
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-<tab>-<tab>
4343
py-trees-demo-action-behaviour py-trees-demo-context-switching py-trees-demo-logging
4444
py-trees-demo-behaviour-lifecycle py-trees-demo-display-modes py-trees-demo-pick-up-where-you-left-off
4545
py-trees-demo-blackboard py-trees-demo-dot-graphs py-trees-demo-selector
4646
py-trees-demo-blackboard-namespaces py-trees-demo-either-or py-trees-demo-sequence
4747
py-trees-demo-blackboard-remappings py-trees-demo-eternal-guard py-trees-demo-tree-stewardship
48-
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
48+
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
4949
...
50-
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
50+
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ exit
5151
5252
# Hack some Code
5353
5454
# Run the Formatter, Tests, Linters and Mypy
5555
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
56-
py38 py310 format check mypy38 mypy310
56+
py310 py312 format check mypy310 mypy312
5757
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
5858
...
59-
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
59+
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
6060
...
6161
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
6262
...

0 commit comments

Comments
 (0)