From 36a3604b90762307dddd1ff2b89387f84b6ec66c Mon Sep 17 00:00:00 2001
From: Samruddhi Khandale <skhandale@microsoft.com>
Date: Tue, 17 Oct 2023 15:05:01 -0700
Subject: [Python] - Support 3.12 (#726)

---
 test/python/install_python_3_12.sh | 38 ++++++++++++++++++++++++++++++++++++++
 test/python/scenarios.json         | 10 +++++++++-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100755 test/python/install_python_3_12.sh

(limited to 'test/python')

diff --git a/test/python/install_python_3_12.sh b/test/python/install_python_3_12.sh
new file mode 100755
index 0000000..2437aef
--- /dev/null
+++ b/test/python/install_python_3_12.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+check "python version 3.12 installed as default" bash -c "python --version | grep 3.12"
+check "python3 version 3.12 installed as default" bash -c "python3 --version | grep 3.12"
+
+# Check that tools can execute - make sure something didn't get messed up in this scenario
+check "autopep8" autopep8 --version
+check "black" black --version
+check "yapf" yapf --version
+check "bandit" bandit --version
+check "flake8" flake8 --version
+check "mypy" mypy --version
+check "pycodestyle" pycodestyle --version
+check "pydocstyle" pydocstyle --version
+check "pylint" pylint --version
+check "pytest" pytest --version
+
+# Check paths in settings
+check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python"
+check "current symlink works" /usr/local/python/current/bin/python --version
+check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8"
+check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black"
+check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf"
+check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit"
+check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8"
+check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy"
+check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle"
+check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle"
+check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint"
+check "which pytest" bash -c "which pytest | grep /usr/local/py-utils/bin/pytest"
+
+# Report result
+reportResults
diff --git a/test/python/scenarios.json b/test/python/scenarios.json
index c3c55d5..23b6cfc 100644
--- a/test/python/scenarios.json
+++ b/test/python/scenarios.json
@@ -32,7 +32,7 @@
         }
     },
     "install_os_provided_python": {
-        "image": "mcr.microsoft.com/devcontainers/base:0-bullseye",
+        "image": "mcr.microsoft.com/devcontainers/base:1-bullseye",
         "features": {
             "python": "os-provided"
         }
@@ -73,5 +73,13 @@
                 "configureJupyterlabAllowOrigin": "*"
             }
         }
+    },
+    "install_python_3_12": {
+        "image": "mcr.microsoft.com/devcontainers/base:1-ubuntu-22.04",
+        "features": {
+            "python": {
+                "version": "3.12"
+            }
+        }
     }
 }
-- 
cgit v1.2.3