From 8394d09b01a5fbfd3be3cc12e6973d422e6d6390 Mon Sep 17 00:00:00 2001 From: Bernie White Date: Mon, 11 Nov 2024 17:20:06 +1000 Subject: [PATCH] Fix codespace build (#3178) --- .devcontainer/container-build.ps1 | 15 +++++---------- .devcontainer/devcontainer.json | 16 +++++++--------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.devcontainer/container-build.ps1 b/.devcontainer/container-build.ps1 index a0b0b203d61..08eefb16cc3 100644 --- a/.devcontainer/container-build.ps1 +++ b/.devcontainer/container-build.ps1 @@ -4,18 +4,13 @@ # Note: # This is run during container creation. -# Install Python 3 dependencies -sudo apt-get update -sudo apt-get install dotnet-sdk-8.0 -y -sudo apt-get install python3-pip -y -sudo python3 -m pip install --upgrade pip -sudo python3 -m pip install wheel +sudo apt-get update -y +sudo apt-get upgrade -y +dotnet restore -# Install Python packages -pip install -r requirements-docs.txt +# . /home/vscode/python/dev/bin/Activate.ps1 -# Restore .NET packages -dotnet restore +pip install -r requirements-docs.txt # Install PowerShell dependencies $ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue; diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8fa9ea56e1a..56de2614b2a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "terminal.integrated.defaultProfile.linux": "pwsh", "terminal.integrated.profiles.linux": { "pwsh": { - "path": "/usr/local/bin/pwsh" + "path": "/usr/bin/pwsh" } } }, @@ -34,17 +34,15 @@ "ghcr.io/devcontainers/features/github-cli:1": { "version": "latest" }, - "ghcr.io/devcontainers/features/powershell:1": { - "version": "latest" - }, - "ghcr.io/devcontainers/features/python:1": { + "ghcr.io/devcontainers/features/azure-cli": { "version": "latest" }, - "ghcr.io/devcontainers/features/azure-cli": { + "ghcr.io/devcontainers/features/python": { "version": "latest" } }, - "onCreateCommand": "sudo chown -R vscode:vscode /opt/microsoft/powershell/7/pwsh && sudo chmod u+x /opt/microsoft/powershell/7/pwsh && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb && sudo apt-get update && sudo apt-get install dotnet-sdk-8.0 -y && sudo apt-get install python3-pip -y", - "updateContentCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1", - "postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1" + "onCreateCommand": "dotnet tool install --global PowerShell --version 7.4.6 && sudo chown -R vscode:vscode /usr/bin/pwsh && sudo apt-get update -y && sudo apt-get upgrade -y && dotnet restore && pip install -r requirements-docs.txt && ln /usr/bin/pwsh /home/vscode/.dotnet/tools/pwsh --force", + "updateContentCommand": "/usr/bin/pwsh -f .devcontainer/container-build.ps1", + "postStartCommand": "/usr/bin/pwsh -f .devcontainer/container-start.ps1" + // && sudo apt-get install python3-pip python3-wheel python3-venv -y && python3 -m venv /home/vscode/python/dev && echo \"source /home/vscode/python/dev/bin/activate\" >> /home/vscode/.bashrc && }