Skip to content

Commit

Permalink
Improve VSCode experience (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggravlingen authored Sep 18, 2022
1 parent d9ba13d commit a6d5d10
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 45 deletions.
6 changes: 2 additions & 4 deletions .devcontainer/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT=3.10-bullseye
ARG VARIANT=3.9-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

ENV VIRTUAL_ENV=/opt/.venv
Expand All @@ -13,6 +13,4 @@ WORKDIR $FILE_LOCATION
RUN sudo python3 -m venv $VIRTUAL_ENV && \
sudo chown -R $LOCAL_USER:$LOCAL_USER ${VIRTUAL_ENV} && \
. $VIRTUAL_ENV/bin/activate && \
python3 -m pip install --upgrade pip setuptools wheel Cython tox && \
python3 -m pip install -r $FILE_LOCATION/requirements.txt && \
python3 -m pip install -r $FILE_LOCATION/requirements_test.txt
python3 -m pip install --upgrade pip setuptools wheel Cython tox
73 changes: 34 additions & 39 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
{
"name": "PYesef dev",
"context": "..",
"dockerFile": "Dockerfile.dev",
"postCreateCommand": "script/setup",
"postStartCommand": "script/bootstrap",
"containerEnv": {
"DEVCONTAINER": "1"
},
"settings": {
"python.pythonPath": "/opt/.venv/bin/python",
"python.defaultInterpreterPath": "/opt/.venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.formatting.provider": "black",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.formatting.blackArgs": [
"-S",
"--line-length",
"88"
],
"python.linting.enabled": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"python.languageServer": "Pylance",
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"rainbow_csv.autodetection_min_line_count": 3
},
"extensions": [
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"esbenp.prettier-vscode",
"mechatroner.rainbow-csv"
]
"name": "PyESEF dev",
"context": "..",
"dockerFile": "Dockerfile.dev",
"postCreateCommand": "script/setup",
"containerEnv": {
"DEVCONTAINER": "1"
},
"settings": {
"python.pythonPath": "/opt/.venv/bin/python",
"python.defaultInterpreterPath": "/opt/.venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.formatting.provider": "black",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.formatting.blackArgs": ["-S", "--line-length", "88"],
"python.linting.enabled": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"python.languageServer": "Pylance",
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"rainbow_csv.autodetection_min_line_count": 3
},
"extensions": [
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"esbenp.prettier-vscode",
"mechatroner.rainbow-csv"
]
}
7 changes: 5 additions & 2 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set -e

cd "$(dirname "$0")/.."

echo "Installing development dependencies..."
echo "Installing dependencies..."

. $VIRTUAL_ENV/bin/activate && python3 -m pip install -e .
. $VIRTUAL_ENV/bin/activate \
&& python3 -m pip install -r requirements.txt \
&& python3 -m pip install -r requirements_test.txt \
&& python3 -m pip install -e .
2 changes: 2 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ set -e

cd "$(dirname "$0")/../"

script/bootstrap

pre-commit install

0 comments on commit a6d5d10

Please sign in to comment.