-
Notifications
You must be signed in to change notification settings - Fork 1
Adopt devcontainer from https://github.com/jbcoe/pytorch-sandbox #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds devcontainer support to enable consistent development environments using Docker and VS Code's devcontainer feature. The configuration is copied from the pytorch-sandbox repository and adapted for this project.
Changes:
- Added devcontainer configuration with Python 3.12 base image
- Configured VS Code extensions for Python development (Ruff, Pylance, Jupyter, mypy)
- Set up non-root user environment with uv package manager
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .devcontainer/devcontainer.json | Defines the devcontainer configuration including VS Code extensions, settings, mounts, and environment variables |
| .devcontainer/Dockerfile | Creates a Python 3.12-slim based container with essential development tools and uv package manager |
| .devcontainer/.dockerfilelintrc | Configures dockerfile linting to allow sudo usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.devcontainer/devcontainer.json
Outdated
| }, | ||
| "mounts": [ | ||
| "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", | ||
| "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SSH mount attempts to support both Unix (HOME) and Windows (USERPROFILE) by concatenating environment variables. However, if both variables are set (which can happen on Windows with Git Bash or WSL), this will concatenate both paths creating an invalid path. A more robust approach would be to use conditional mounting or test this configuration on both platforms to ensure it works as intended.
| "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" | |
| "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just use the UNIX-compliant path.
.devcontainer/devcontainer.json
Outdated
| @@ -0,0 +1,52 @@ | |||
| { | |||
| "name": "py_cppmodel Dev Container", | |||
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container name uses an underscore ("py_cppmodel Dev Container") while the project name in pyproject.toml uses a hyphen ("py-cppmodel"). For consistency with the project naming conventions, consider using "py-cppmodel Dev Container" instead.
| "name": "py_cppmodel Dev Container", | |
| "name": "py-cppmodel Dev Container", |
Closes #6