From d317c0ff3640e47c1f0c697993593bac73feabf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Sat, 8 Jun 2024 13:05:23 +0000 Subject: [PATCH] Keep terminals hidden and auto-close; this should remove any disturbances for devs who are not using the Dev Container --- .devcontainer/Welcome.md | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 8 ++++++-- .devcontainer/scripts/install.sh | 2 ++ .devcontainer/scripts/open-vnc-browser.sh | 2 +- .vscode/tasks.json | 14 +++++++++++--- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .devcontainer/Welcome.md diff --git a/.devcontainer/Welcome.md b/.devcontainer/Welcome.md new file mode 100644 index 00000000000..19a54c75258 --- /dev/null +++ b/.devcontainer/Welcome.md @@ -0,0 +1,16 @@ +# šŸ‘‹ Welcome to the MNE-Python Dev Container! + +It's so great to see you! šŸ¤© + +This appears to be the first time you're starting up the container, +or you've restarted it after uninstalling MNE-Python. + +In any case, **we're currently running the MNE-Python installation +procedure.** You can view progress by opening the terminal window +with the the spinning icon (or exclamation mark, in some cases!) in the bottom-right of +your screen! + +Once installation is finished, that terminal window will close and your browser will +open to connect you to a VNC desktop. This is where interactive plots will appear. + +Enjoy, have a great day, and: **Happy hacking!** šŸš€šŸš€šŸš€ \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 77abb2a7adb..7bcd8744459 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -34,7 +34,7 @@ // Conda "ghcr.io/mamba-org/devcontainer-features/micromamba:1": { "channels": "conda-forge", - "packages": "conda python h5py vtk pyside6 cftime psutil pipx" + "packages": "conda python h5py vtk pyside6 psutil pipx" }, // Docker interface with host's Docker service "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, @@ -95,7 +95,11 @@ "redhat.telemetry.enabled": false, "workbench.enableExperiments": false, // Should not be necessary if telemetry is off, but let's make it explicit. // Avoid accumulation of unused forwarded ports. - "remote.restoreForwardedPorts": false + "remote.restoreForwardedPorts": false, + // Always open Markdown files in the preview (i.e., rendered); double-clicking on a line openes the editor. + "workbench.editorAssociations": { + "*.md": "vscode.markdown.preview.editor" + } }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ diff --git a/.devcontainer/scripts/install.sh b/.devcontainer/scripts/install.sh index aa86fa48694..5b54ce205fa 100755 --- a/.devcontainer/scripts/install.sh +++ b/.devcontainer/scripts/install.sh @@ -19,8 +19,10 @@ cd ~ if python -c "import $import_name" &> /dev/null; then echo -e "āœ… $package_name is already installed.\n" cd "${orig_dir}" + exit else cd "${orig_dir}" + code .devcontainer/Welcome.md echo -e "šŸ’” $package_name is not installed. Installing now ā€¦\n" pipx run uv pip install -e ".[full-pyside6,dev,test_extra]" echo -e "\nāœ… $package_name has been installed.\n" diff --git a/.devcontainer/scripts/open-vnc-browser.sh b/.devcontainer/scripts/open-vnc-browser.sh index 821b82dfd67..ab05a0e297c 100755 --- a/.devcontainer/scripts/open-vnc-browser.sh +++ b/.devcontainer/scripts/open-vnc-browser.sh @@ -10,4 +10,4 @@ fi echo -e "šŸŒ Opening VNC desktop in web browser ā€¦\n" xdg-open 'http://localhost:6080?autoconnect=true' -echo -e "Welcome to the MNE-Python Dev Container!\nCreate a plot in VS Code and it will show up here." | xmessage -center -timeout 60 -title "Welcome to MNE-Python!" -file - +echo -e "Welcome to the MNE-Python Dev Container!\nCreate a plot in VS Code and it will show up here." | xmessage -center -timeout 30 -title "Welcome to MNE-Python!" -file - diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6bab9abeb46..bd76b8031af 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,20 +7,28 @@ "label": "Install MNE-Python (dev)", "type": "shell", "command": ".devcontainer/scripts/install.sh", - "problemMatcher": [], "runOptions": { "runOn": "folderOpen" + }, + "presentation": { + "showReuseMessage": false, + "reveal": "silent", + "close": true } }, { "label": "Open VNC Desktop in Browser", "type": "shell", "command": ".devcontainer/scripts/open-vnc-browser.sh", - "problemMatcher": [], "runOptions": { "runOn": "folderOpen" }, - "dependsOn": ["Install MNE-Python (dev)"] + "dependsOn": ["Install MNE-Python (dev)"], + "presentation": { + "showReuseMessage": false, + "reveal": "silent", + "close": true + } } ] }