Skip to content

Commit

Permalink
Keep terminals hidden and auto-close; this should remove any disturba…
Browse files Browse the repository at this point in the history
…nces for devs who are not using the Dev Container
  • Loading branch information
hoechenberger committed Jun 8, 2024
1 parent 0b7bd34 commit d317c0f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Welcome.md
Original file line number Diff line number Diff line change
@@ -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!** 🚀🚀🚀
8 changes: 6 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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": [
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/scripts/open-vnc-browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
14 changes: 11 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
]
}

0 comments on commit d317c0f

Please sign in to comment.