-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add devcontainer for easier external contribution (#18694)
* add devcontainer * add readme
- Loading branch information
1 parent
7d5b12b
commit bac3a2a
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Dev container configurations | ||
|
||
This directory contains the configuration for dev containers, which is used to | ||
initialize the development environment in **Codespaces**, **Visual Studio | ||
Code**, and **JetBrains IDEs**. The environment is installed with all the | ||
necessary dependencies for development and is ready for linting, formatting, and | ||
running tests. | ||
|
||
* **GitHub Codespaces**. Create a codespace for the repo by clicking | ||
the "Code" button on the main page of the repo, selecting the "Codespaces" | ||
tab, and clicking the "+". The configurations will automatically be used. | ||
Follow | ||
[this guide](https://docs.github.com/en/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository) | ||
for more details. | ||
|
||
* **Visual Studio Code**. Open the root folder of the repo in VS Code. A | ||
notification will pop up to open it in a dev container with the | ||
configuration. Follow | ||
[this guide](https://code.visualstudio.com/docs/devcontainers/tutorial) | ||
for more details. | ||
|
||
* **JetBrains IDEs**. Open the `.devcontainer/devcontainer.json` in your | ||
JetBrains IDE. Click the docker icon to create a dev container. | ||
Follow | ||
[this guide](https://www.jetbrains.com/help/idea/connect-to-devcontainer.html) | ||
for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.10", | ||
"postCreateCommand": "sh ./.devcontainer/setup.sh", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
}, | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.isort", | ||
"ms-python.flake8", | ||
"ms-python.black-formatter" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sudo pip install --upgrade pip | ||
sudo pip install -r requirements.txt | ||
echo "bash shell/lint.sh" > .git/hooks/pre-commit | ||
chmod a+x .git/hooks/pre-commit |