Skip to content

Commit c825ae4

Browse files
Python 3.14 (#236)
* Consistent capitalisation in dockerfile * Bump 3.13 to 3.13.2 and make the default 3.13.3 has a bug with tests. This is fixed on the 3.13 dev branch, so will likely be part of 3.13.4 See this commit for more info python/cpython@cc39b19 * Remove 3.12 in favour of 3.14-dev * Bump numpy version installed in dev to one that works for 3.13 * Bump eval deps to latest versions This commit also updates which dependencies are installed in each verison of Python, according to what works where. * update tests to use new default python version * Replace deprecated ubuntu 20.04 CI runner with 24.04 * Only test on ubuntu-latest We previously used a matrixc to test cgroups v1 & v2. Now that ubuntu 20.04 is no longer supported by GitHub, we not longer have access to a runner with v1 cgroups.
2 parents 04aa999 + 3027f4b commit c825ae4

File tree

4 files changed

+41
-45
lines changed

4 files changed

+41
-45
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ on:
1111
jobs:
1212
test:
1313
name: Test with coverage
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: [ubuntu-20.04, ubuntu-22.04]
18-
14+
runs-on: ubuntu-latest
1915
steps:
2016
- name: Download image artifact
2117
uses: actions/download-artifact@v4
@@ -40,7 +36,7 @@ jobs:
4036
run: |
4137
export IMAGE_SUFFIX='-venv:${{ inputs.version }}'
4238
docker compose run \
43-
--rm -T -e COVERAGE_DATAFILE=.coverage.${{ matrix.os }} \
39+
--rm -T -e COVERAGE_DATAFILE=.coverage \
4440
--entrypoint coverage \
4541
snekbox \
4642
run -m unittest
@@ -49,8 +45,8 @@ jobs:
4945
- name: Upload coverage data
5046
uses: actions/upload-artifact@v4
5147
with:
52-
name: coverage-${{ matrix.os }}
53-
path: .coverage.*
48+
name: coverage
49+
path: .coverage
5450
retention-days: 1
5551
include-hidden-files: true
5652

@@ -76,12 +72,9 @@ jobs:
7672
- name: Download coverage data
7773
uses: actions/download-artifact@v4
7874
with:
79-
pattern: coverage-*
75+
pattern: coverage
8076
merge-multiple: true
8177

82-
- name: Combine coverage data
83-
run: coverage combine .coverage.*
84-
8578
- name: Display coverage report
8679
run: coverage report -m
8780

Dockerfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.4
2-
FROM buildpack-deps:bookworm as builder-nsjail
2+
FROM buildpack-deps:bookworm AS builder-nsjail
33

44
WORKDIR /nsjail
55

@@ -17,7 +17,7 @@ RUN git clone -b master --single-branch https://github.com/google/nsjail.git . \
1717
RUN make
1818

1919
# ------------------------------------------------------------------------------
20-
FROM buildpack-deps:bookworm as builder-py-base
20+
FROM buildpack-deps:bookworm AS builder-py-base
2121

2222
ENV PYENV_ROOT=/pyenv \
2323
PYTHON_CONFIGURE_OPTS='--disable-test-modules --enable-optimizations \
@@ -29,21 +29,21 @@ RUN apt-get -y update \
2929
tk-dev \
3030
&& rm -rf /var/lib/apt/lists/*
3131

32-
RUN git clone -b v2.4.23 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT
32+
RUN git clone -b v2.5.7 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT
3333

3434
COPY --link scripts/build_python.sh /
3535

3636
# ------------------------------------------------------------------------------
37-
FROM builder-py-base as builder-py-3_12
38-
RUN /build_python.sh 3.12.8
37+
FROM builder-py-base AS builder-py-3_13
38+
RUN /build_python.sh 3.13.2
3939
# ------------------------------------------------------------------------------
40-
FROM builder-py-base as builder-py-3_13
41-
RUN /build_python.sh 3.13.1
40+
FROM builder-py-base AS builder-py-3_13t
41+
RUN /build_python.sh 3.13.2t
4242
# ------------------------------------------------------------------------------
43-
FROM builder-py-base as builder-py-3_13t
44-
RUN /build_python.sh 3.13.1t
43+
FROM builder-py-base AS builder-py-3_14
44+
RUN /build_python.sh 3.14-dev
4545
# ------------------------------------------------------------------------------
46-
FROM python:3.13-slim-bookworm as base
46+
FROM python:3.13-slim-bookworm AS base
4747

4848
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
4949
PIP_NO_CACHE_DIR=false
@@ -57,15 +57,15 @@ RUN apt-get -y update \
5757
&& rm -rf /var/lib/apt/lists/*
5858

5959
COPY --link --from=builder-nsjail /nsjail/nsjail /usr/sbin/
60-
COPY --link --from=builder-py-3_12 /snekbin/ /snekbin/
6160
COPY --link --from=builder-py-3_13 /snekbin/ /snekbin/
6261
COPY --link --from=builder-py-3_13t /snekbin/ /snekbin/
62+
COPY --link --from=builder-py-3_14 /snekbin/ /snekbin/
6363

6464
RUN chmod +x /usr/sbin/nsjail \
65-
&& ln -s /snekbin/python/3.12/ /snekbin/python/default
65+
&& ln -s /snekbin/python/3.13/ /snekbin/python/default
6666

6767
# ------------------------------------------------------------------------------
68-
FROM base as venv
68+
FROM base AS venv
6969

7070
COPY --link requirements/ /snekbox/requirements/
7171
COPY --link scripts/install_eval_deps.sh /snekbox/scripts/install_eval_deps.sh
@@ -83,7 +83,7 @@ RUN if [ -n "${DEV}" ]; \
8383
then \
8484
pip install -U -r requirements/coverage.pip \
8585
&& export PYTHONUSERBASE=/snekbox/user_base \
86-
&& /snekbin/python/default/bin/python -m pip install --user numpy~=1.19; \
86+
&& /snekbin/python/default/bin/python -m pip install --user numpy~=2.2.5; \
8787
fi
8888

8989
# At the end to avoid re-installing dependencies when only a config changes.

requirements/eval-deps.pip

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
anyio[trio]~=4.7
1+
anyio[trio]~=4.9
22
arrow~=1.3
3-
attrs~=24.3
4-
beautifulsoup4~=4.12
5-
einspect~=0.5; python_version == '3.12'
6-
fishhook~=0.3; python_version == '3.12'
3+
attrs~=25.3
4+
beautifulsoup4~=4.13
5+
6+
# These packages don't support 3.13, 3.13t, nor 3.14-dev, so are commented out for now.
7+
# einspect~=0.5
8+
# fishhook~=0.3
9+
710
forbiddenfruit~=0.1
811
fuzzywuzzy~=0.18
912
kaleido~=0.2
1013
lark~=1.2
11-
matplotlib~=3.10; python_version == '3.12'
12-
more-itertools~=10.5
14+
matplotlib~=3.10; python_version == "3.13"
15+
more-itertools~=10.7
1316
networkx~=3.4
14-
numpy~=2.2
15-
pandas~=2.2
16-
pendulum~=3.0; python_version == '3.12'
17-
pyarrow~=18.1
17+
numpy~=2.2; python_version == "3.13"
18+
pandas~=2.2; python_version == "3.13"
19+
pendulum~=3.1
20+
pyarrow~=20.0; python_version == "3.13"
1821
python-dateutil~=2.9
1922
pyyaml~=6.0
20-
scipy~=1.15
21-
sympy~=1.13
22-
typing-extensions~=4.12
23-
tzdata~=2024.2
24-
yarl~=1.18
23+
scipy~=1.15; python_version == "3.13"
24+
sympy~=1.14
25+
typing-extensions~=4.13
26+
tzdata~=2025.2
27+
yarl~=1.20

tests/test_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ def test_alternate_executable_support(self):
6161
cases = [
6262
(
6363
get_python_version_body,
64-
"3.12\n",
64+
"3.13\n",
6565
"test default executable is used when executable_path not specified",
6666
),
6767
(
6868
get_python_version_body
69-
| {"executable_path": "/snekbin/python/3.12/bin/python"},
70-
"3.12\n",
69+
| {"executable_path": "/snekbin/python/3.13/bin/python"},
70+
"3.13\n",
7171
"test default executable is used when explicitly set",
7272
),
7373
(

0 commit comments

Comments
 (0)