Skip to content

Commit 4cea31b

Browse files
authored
Simlify devcontainer.json configuration and builds (#658)
* update lockfile * remove custom dockerfile and user devcontainer feature for uv. simplify install script
1 parent 954661c commit 4cea31b

File tree

6 files changed

+184
-261
lines changed

6 files changed

+184
-261
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

.devcontainer/Dockerfile.dev

Lines changed: 0 additions & 46 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/python
31
{
4-
"build": {
5-
"dockerfile": "Dockerfile.dev",
6-
"context": ".."
7-
},
8-
// Use 'postCreateCommand' to run commands after the container is created.
9-
"postCreateCommand": {
10-
// "post_create_script": "bash ./.devcontainer/post-install.sh"
11-
},
12-
// Forward 8787 to enable us to view dask dashboard
13-
"forwardPorts": [8787],
2+
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
143
// Configure tool-specific properties.
4+
"features": {
5+
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "0.8.15" }
6+
},
157
"customizations": {
16-
// Configure properties specific to VS Code.
178
"vscode": {
189
"settings": {
10+
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python",
1911
"python.testing.pytestArgs": ["tests"],
2012
"python.testing.unittestEnabled": false,
2113
"python.testing.pytestEnabled": true
@@ -33,14 +25,17 @@
3325
"visualstudioexptteam.vscodeintellicode",
3426
"richie5um2.vscode-sort-json"
3527
]
28+
},
29+
"jetbrains": {
30+
"plugins": ["com.koxudaxi.pydantic", "com.koxudaxi.ruff"]
3631
}
3732
},
38-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
39-
// "remoteUser": "root",
40-
"updateRemoteUserUID": true,
4133
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/mdio-python,type=bind",
4234
"workspaceFolder": "/workspaces/mdio-python",
43-
"mounts": [
44-
// "source=${localWorkspaceFolder}/../DATA/,target=/DATA/,type=bind,consistency=cached"
45-
]
35+
// This installs the MDIO dev environment in the container. Put any customizations there.
36+
"postCreateCommand": "bash .devcontainer/post-create.sh",
37+
// Forward 8787 to enable us to view the dask dashboard
38+
"forwardPorts": [8787]
39+
// Add any mounts you want to use here.
40+
//"mounts": [ "source=${localWorkspaceFolder}/../DATA/,target=/DATA/,type=bind,consistency=cached" ]
4641
}

.devcontainer/post-create.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Sync the environment, installing the project editable and including dev dependencies
6+
uv sync
7+
8+
# Set Git safe directory to avoid ownership issues
9+
git config --global --add safe.directory "$PWD"
10+
11+
# Optional: If you need to reset GitHub host key for SSH (uncomment if necessary)
12+
# ssh-keygen -f "/home/vscode/.ssh/known_hosts" -R "github.com"

.devcontainer/post-install.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)