Skip to content
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

Dev Container #2903

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Codespell Development Environment",
// TODO: Switch to image 'mcr.microsoft.com/devcontainers/python:1-3' once
// https://github.com/codespell-project/codespell/issues/2897 has been
// resolved.
korverdev marked this conversation as resolved.
Show resolved Hide resolved
"image": "mcr.microsoft.com/devcontainers/python:1-3-bullseye",
"customizations": {
"vscode": {
"extensions": [
"github.vscode-github-actions",
korverdev marked this conversation as resolved.
Show resolved Hide resolved
"ms-python.python",
"python.vscode-pylance"
DimitriPapadopoulos marked this conversation as resolved.
Show resolved Hide resolved
]
}
},
"postCreateCommand": "bash .devcontainer/post_create.sh"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korverdev Could you change above line to:

 "postCreateCommand": ["bash", ".devcontainer/post_create.sh"]

This will avoid spawning an additional shell according to the Development Containers specification:

Formatting string vs. array properties

The format of certain properties will vary depending on the involvement of a shell.

postCreateCommand, postStartCommand, postAttachCommand, and initializeCommand all have 3 types:

  • Array: Passed to the OS for execution without going through a shell
  • String: Goes through a shell (it needs to be parsed into command and arguments)
  • Object: All lifecycle scripts have been extended to support object types to allow for parallel execution

}
12 changes: 12 additions & 0 deletions .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

sudo apt-get update
sudo apt-get install -y libaspell-dev
DimitriPapadopoulos marked this conversation as resolved.
Show resolved Hide resolved

pip install --upgrade \
aspell-python-py3 \
pip \
setuptools \
setuptools_scm \
wheel
pip install -e '.[dev]'
DimitriPapadopoulos marked this conversation as resolved.
Show resolved Hide resolved