-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: working version of a devcontainer
- Loading branch information
Showing
7 changed files
with
111 additions
and
141 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,23 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/python-3/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster | ||
ARG VARIANT="3.10-bullseye" | ||
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} | ||
|
||
ENV POETRY_HOME="/home/vscode/.poetry" | ||
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" | ||
ENV POETRY_VERSION=1.7.1 | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
htop \ | ||
fzf \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
RUN pipx install poetry==${POETRY_VERSION} | ||
|
||
# Add fzf to .zshrc | ||
RUN echo "source /usr/share/doc/fzf/examples/key-bindings.zsh" >> /home/vscode/.zshrc | ||
RUN echo "source /usr/share/doc/fzf/examples/completion.zsh" >> /home/vscode/.zshrc |
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,73 @@ | ||
{ | ||
"name": "OTGdev", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
"VARIANT": "3.10-bullseye", | ||
"POETRY_VERSION": "1.7.1" | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {}, | ||
"ghcr.io/devcontainers/features/python:1": { | ||
"version": "3.10" | ||
}, | ||
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}, | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} | ||
}, | ||
"mounts": [ | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind", | ||
"source=devcontainer-bashhistory,target=/commandhistory,type=volume", | ||
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached" | ||
], | ||
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"charliermarsh.ruff", | ||
"ms-python.isort", | ||
"ms-python.mypy-type-checker", | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"esbenp.prettier-vscode", | ||
"mhutchie.git-graph", | ||
"eamodio.gitlens", | ||
"ms-azuretools.vscode-docker", | ||
"github.vscode-github-actions", | ||
"timonwong.shellcheck", | ||
"GitHub.copilot", | ||
"vivaxy.vscode-conventional-commits", | ||
"ms-vscode-remote.remote-ssh", | ||
"ms-toolsai.jupyter", | ||
"ms-vscode.makefile-tools" | ||
], | ||
"settings": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"workbench.startupEditor": "readme", | ||
"terminal.integrated.fontFamily": "Fira Code", | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": false, | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"python.terminal.launchArgs": ["-m", "IPython", "--no-autoindent"], | ||
"isort.args": ["--profile", "black"], | ||
"python.testing.pytestArgs": [".", "--doctest-modules", "--cov=src/"], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"mypy-type-checker.severity": { | ||
"error": "Information" | ||
}, | ||
"ruff.fixAll": false, | ||
"ruff.organizeImports": false | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
#!/bin/bash | ||
|
||
# Install Poetry environment | ||
poetry install --no-interaction --no-root --no-cache | ||
|
||
# Install Pre-commit hooks | ||
poetry run pre-commit install --install-hooks |
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
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
Oops, something went wrong.