diff options
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/devcontainer-feature.json | 7 | ||||
-rwxr-xr-x | src/python/install.sh | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index f2d116e..8f8faae 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "python", - "version": "1.0.10", + "version": "1.0.11", "name": "Python", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/python", "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.", @@ -60,7 +60,7 @@ "ms-python.vscode-pylance" ], "settings": { - "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.defaultInterpreterPath": "/usr/local/python/current/bin/python", "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", "python.formatting.blackPath": "/usr/local/py-utils/bin/black", "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", @@ -74,6 +74,7 @@ } }, "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils" + "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/devcontainers/features/oryx" ] } diff --git a/src/python/install.sh b/src/python/install.sh index ac5eec6..de1b0e6 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -299,6 +299,9 @@ install_using_oryx() { echo "(!) Python version ${VERSION} already exists." exit 1 fi + + # The python install root path may not exist, so create it + mkdir -p "${PYTHON_INSTALL_PATH}" oryx_install "python" "${VERSION}" "${INSTALL_PATH}" "lib" || return 1 ln -s "${INSTALL_PATH}/bin/idle3" "${INSTALL_PATH}/bin/idle" @@ -339,11 +342,15 @@ install_python() { # If the os-provided versions are "good enough", detect that and bail out. if [ ${PYTHON_VERSION} = "os-provided" ] || [ ${PYTHON_VERSION} = "system" ]; then check_packages python3 python3-doc python3-pip python3-venv python3-dev python3-tk - PYTHON_ROOT="/usr/bin" + INSTALL_PATH="/usr" + + ln -s "${INSTALL_PATH}/bin/python3" "${INSTALL_PATH}/bin/python" + ln -s "${INSTALL_PATH}/bin/pydoc3" "${INSTALL_PATH}/bin/pydoc" + ln -s "${INSTALL_PATH}/bin/python3-config" "${INSTALL_PATH}/bin/python-config" - ln -s "${PYTHON_ROOT}/python3" "${PYTHON_ROOT}/python" - ln -s "${PYTHON_ROOT}/pydoc3" "${PYTHON_ROOT}/pydoc" - ln -s "${PYTHON_ROOT}/python3-config" "${PYTHON_ROOT}/python-config" + # Add the current symlink but point it to "/usr" since python is at /usr/bin/python + mkdir -p "${PYTHON_INSTALL_PATH}" + add_symlink should_install_from_source=false elif [ "$(dpkg --print-architecture)" = "amd64" ] && [ "${USE_ORYX_IF_AVAILABLE}" = "true" ] && type oryx > /dev/null 2>&1; then |