Skip to content

Commit 36a3604

Browse files
[Python] - Support 3.12 (#726)
1 parent 4fca96b commit 36a3604

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

src/python/devcontainer-feature.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "python",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"name": "Python",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/python",
66
"description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",
@@ -11,6 +11,7 @@
1111
"latest",
1212
"os-provided",
1313
"none",
14+
"3.12",
1415
"3.11",
1516
"3.10",
1617
"3.9",

src/python/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CONFIGURE_JUPYTERLAB_ALLOW_ORIGIN="${CONFIGUREJUPYTERLABALLOWORIGIN:-""}"
2727
ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}"
2828

2929
DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv" "pytest")
30-
PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5"
30+
PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5 A821E680E5FA6305"
3131
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
3232
keyserver hkps://keys.openpgp.org
3333
keyserver hkp://keyserver.pgp.com"

test/python/install_python_3_12.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
check "python version 3.12 installed as default" bash -c "python --version | grep 3.12"
9+
check "python3 version 3.12 installed as default" bash -c "python3 --version | grep 3.12"
10+
11+
# Check that tools can execute - make sure something didn't get messed up in this scenario
12+
check "autopep8" autopep8 --version
13+
check "black" black --version
14+
check "yapf" yapf --version
15+
check "bandit" bandit --version
16+
check "flake8" flake8 --version
17+
check "mypy" mypy --version
18+
check "pycodestyle" pycodestyle --version
19+
check "pydocstyle" pydocstyle --version
20+
check "pylint" pylint --version
21+
check "pytest" pytest --version
22+
23+
# Check paths in settings
24+
check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python"
25+
check "current symlink works" /usr/local/python/current/bin/python --version
26+
check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8"
27+
check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black"
28+
check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf"
29+
check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit"
30+
check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8"
31+
check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy"
32+
check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle"
33+
check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle"
34+
check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint"
35+
check "which pytest" bash -c "which pytest | grep /usr/local/py-utils/bin/pytest"
36+
37+
# Report result
38+
reportResults

test/python/scenarios.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
"install_os_provided_python": {
35-
"image": "mcr.microsoft.com/devcontainers/base:0-bullseye",
35+
"image": "mcr.microsoft.com/devcontainers/base:1-bullseye",
3636
"features": {
3737
"python": "os-provided"
3838
}
@@ -73,5 +73,13 @@
7373
"configureJupyterlabAllowOrigin": "*"
7474
}
7575
}
76+
},
77+
"install_python_3_12": {
78+
"image": "mcr.microsoft.com/devcontainers/base:1-ubuntu-22.04",
79+
"features": {
80+
"python": {
81+
"version": "3.12"
82+
}
83+
}
7684
}
7785
}

0 commit comments

Comments
 (0)