Skip to content

Commit b09fe37

Browse files
author
Michael Brewer
authored
chore: setup codespaces (#637)
1 parent 80b1b21 commit b09fe37

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

Diff for: .devcontainer/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
4+
ARG VARIANT="3.9"
5+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
6+
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
7+
8+
# [Option] Install Node.js
9+
ARG INSTALL_NODE="true"
10+
ARG NODE_VERSION="lts/*"
11+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
12+
13+
RUN pip3 install -U pip black poetry pre-commit
14+
15+
# [Optional] Uncomment this section to install additional OS packages.
16+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
17+
&& apt-get -y install --no-install-recommends bash-completion

Diff for: .devcontainer/devcontainer.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
{
3+
"name": "Python 3",
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"context": "..",
7+
"args": {
8+
"VARIANT": "3.9",
9+
"INSTALL_NODE": "true",
10+
"NODE_VERSION": "lts/*"
11+
}
12+
},
13+
"settings": {
14+
"git.enableCommitSigning": true,
15+
"editor.formatOnSave": true,
16+
"python.pythonPath": "/usr/local/bin/python",
17+
"python.languageServer": "Pylance",
18+
"python.linting.enabled": true,
19+
"python.linting.pylintEnabled": true,
20+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
21+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
22+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
23+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
24+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
25+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
26+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
27+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
28+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
29+
"python.testing.pytestArgs": [
30+
"tests"
31+
],
32+
"python.testing.unittestEnabled": false,
33+
"python.testing.nosetestsEnabled": false,
34+
"python.testing.pytestEnabled": true,
35+
"python.formatting.provider": "black"
36+
},
37+
"extensions": [
38+
"ms-python.python",
39+
"ms-python.vscode-pylance",
40+
"littlefoxteam.vscode-python-test-adapter",
41+
"ms-azuretools.vscode-docker",
42+
"davidanson.vscode-markdownlint",
43+
"bungcip.better-toml"
44+
],
45+
"postCreateCommand": "make dev",
46+
"remoteUser": "vscode"
47+
}

0 commit comments

Comments
 (0)