Skip to content

Commit 4c73fb6

Browse files
authored
chore: update devcontainer config
1 parent bee7a07 commit 4c73fb6

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/python-3/.devcontainer/base.Dockerfile
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/python-3/.devcontainer/base.Dockerfile
22

3-
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
4-
ARG VARIANT="3"
3+
# [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
4+
ARG VARIANT="3.10-bullseye"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
66

7-
# [Option] Install Node.js
8-
ARG INSTALL_NODE="true"
9-
ARG NODE_VERSION="lts/*"
10-
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
7+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
1110

1211
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
1312
# COPY requirements.txt /tmp/pip-tmp/
@@ -18,11 +17,11 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l
1817
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1918
# && apt-get -y install --no-install-recommends <your-package-list-here>
2019

21-
# [Optional] Uncomment this line to install global node packages.
22-
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
20+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
21+
&& apt-get -y install --no-install-recommends enchant-2 hunspell-en-gb
2322

24-
USER vscode
25-
ENV PATH="/home/vscode/.poetry/bin:$PATH" \
26-
POETRY_VIRTUALENVS_IN_PROJECT="true"
23+
RUN su vscode -c "curl -sSL https://install.python-poetry.org | python3 - --preview"
24+
RUN su vscode -c "pip --no-cache-dir install --user --upgrade pre-commit"
2725

28-
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
26+
# [Optional] Uncomment this line to install global node packages.
27+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/python-3
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/python-3
33
{
4-
"name": "Python 3",
4+
"name": "conjecture",
55
"build": {
66
"dockerfile": "Dockerfile",
77
"context": "..",
88
"args": {
9-
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
10-
"VARIANT": "3.9",
9+
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
10+
// Append -bullseye or -buster to pin to an OS version.
11+
// Use -bullseye variants on local on arm64/Apple Silicon.
12+
"VARIANT": "3.10-bullseye",
1113
// Options
12-
"INSTALL_NODE": "false",
13-
"NODE_VERSION": "lts/*"
14+
"NODE_VERSION": "none"
1415
}
1516
},
1617
// Set *default* container specific settings.json values on container create.
1718
"settings": {
18-
"terminal.integrated.shell.linux": "/bin/bash",
19-
"editor.formatOnSave": true,
20-
"python.pythonPath": ".venv/bin/python",
21-
"python.linting.enabled": true,
22-
"python.linting.lintOnSave": true,
23-
"python.linting.mypyEnabled": true,
24-
"python.linting.pylintEnabled": true,
25-
"python.linting.pydocstyleEnabled": true,
26-
"python.linting.mypyPath": ".venv/bin/mypy",
27-
"python.linting.pydocstylePath": ".venv/bin/pydocstyle",
28-
"python.linting.pylintPath": ".venv/bin/pylint",
29-
"python.testing.pytestEnabled": true,
30-
"python.testing.pytestArgs": [
31-
"tests"
32-
],
33-
"python.formatting.blackPath": ".venv/bin/black",
3419
"editor.codeActionsOnSave": {
3520
"source.organizeImports": true
3621
},
22+
"files.exclude": {
23+
".pnp.*": true,
24+
".yarn": true,
25+
"**/__pycache__": true,
26+
"**/.mypy_cache": true,
27+
"**/.pytest_cache": true,
28+
"**/.coverage": true,
29+
},
30+
"python.defaultInterpreterPath": "/usr/local/bin/python",
31+
"python.linting.enabled": true,
32+
"python.linting.pylintEnabled": true,
33+
"python.formatting.blackPath": "black",
34+
"python.linting.mypyPath": "mypy",
35+
"python.linting.pylintPath": "pylint",
36+
"python.testing.pytestPath": "pytest",
37+
"python.venvPath": "/home/vscode/.cache/pypoetry/virtualenvs/",
3738
},
3839
// Add the IDs of extensions you want installed when the container is created.
3940
"extensions": [
4041
"ms-python.python",
4142
"ms-python.vscode-pylance",
43+
"bungcip.better-toml",
4244
],
4345
// Use 'forwardPorts' to make a list of ports inside the container available locally.
4446
// "forwardPorts": [],
4547
// Use 'postCreateCommand' to run commands after the container is created.
46-
// "postCreateCommand": "pip3 install --user -r requirements.txt",
47-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
48-
"remoteUser": "vscode"
48+
"postCreateCommand": "make setup",
49+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
50+
"remoteUser": "vscode",
51+
"features": {
52+
"git": "latest",
53+
"github-cli": "latest",
54+
"fish": "latest",
55+
}
4956
}

0 commit comments

Comments
 (0)