Skip to content

Commit 8552b9a

Browse files
committed
chore: use devcontainer
1 parent 1209e09 commit 8552b9a

8 files changed

Lines changed: 1020 additions & 453 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "Python 3 with UV",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "cli",
5+
"workspaceFolder": "/workspaces/laygo",
6+
7+
"features": {
8+
"ghcr.io/devcontainers/features/common-utils:2": {
9+
"upgradePackages": true
10+
},
11+
"ghcr.io/devcontainers/features/git:1": {},
12+
"ghcr.io/devcontainers/features/github-cli:1": {}
13+
},
14+
15+
"postCreateCommand": "curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH=\"$HOME/.cargo/bin:$PATH\" && uv sync --extra dev && uv pip install -e .",
16+
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
"vscode": {
20+
"settings": {
21+
"python.defaultInterpreterPath": ".venv/bin/python",
22+
"python.terminal.activateEnvironment": true,
23+
"python.linting.enabled": true,
24+
"editor.formatOnSave": true,
25+
"editor.defaultFormatter": "charliermarsh.ruff",
26+
"[python]": {
27+
"editor.formatOnSave": true,
28+
"editor.defaultFormatter": "charliermarsh.ruff",
29+
"editor.tabSize": 2,
30+
"editor.indentSize": 2,
31+
"editor.insertSpaces": true,
32+
"editor.codeActionsOnSave": {
33+
"source.fixAll.ruff": "explicit",
34+
"source.organizeImports.ruff": "explicit"
35+
}
36+
}
37+
},
38+
"extensions": [
39+
"ms-python.python",
40+
"ms-python.vscode-pylance",
41+
"charliermarsh.ruff",
42+
"ms-toolsai.jupyter",
43+
"ms-vscode.makefile-tools",
44+
"github.vscode-github-actions"
45+
]
46+
}
47+
},
48+
49+
// Forward ports for potential web servers or APIs
50+
// "forwardPorts": [8000, 8080],
51+
52+
// Uncomment to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
53+
// "remoteUser": "root",
54+
55+
// Mount the workspace folder and preserve file permissions
56+
"mounts": [
57+
"source=${localWorkspaceFolder},target=/workspaces/laygo,type=bind,consistency=cached"
58+
]
59+
}

.devcontainer/docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
services:
2+
cli:
3+
image: mcr.microsoft.com/devcontainers/python:1-3.12-bullseye
4+
working_dir: /workspaces/laygo
5+
6+
# Overrides default command so things don't shut down after the process ends.
7+
command: sleep infinity
8+
9+
# Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
10+
# user: root
11+
12+
environment:
13+
- PYTHONPATH=/workspaces/laygo
14+
- UV_CACHE_DIR=/workspaces/laygo/.uv-cache
15+
- TERM=xterm-256color
16+
17+
# Optional: Add other services for development
18+
19+
# redis:
20+
# image: redis:7-alpine
21+
# ports:
22+
# - "6379:6379"

0 commit comments

Comments
 (0)