add VSCode devcontainer setup
parent
4027677b38
commit
fb4cee14da
@ -0,0 +1,37 @@
|
|||||||
|
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/python-3/.devcontainer/base.Dockerfile
|
||||||
|
|
||||||
|
# [Choice] Python version: 3, 3.10, ...
|
||||||
|
ARG VARIANT=3
|
||||||
|
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
|
||||||
|
|
||||||
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
|
||||||
|
&& apt-get purge -y imagemagick imagemagick-6-common \
|
||||||
|
# Install common packages, non-root user
|
||||||
|
# && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
|
||||||
|
# Clean up
|
||||||
|
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||||
|
|
||||||
|
# [Option] Install Node.js
|
||||||
|
# ARG INSTALL_NODE="false"
|
||||||
|
# ARG NODE_VERSION="lts/*"
|
||||||
|
# RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||||
|
|
||||||
|
# [Optional] Allow the vscode user to pip install globally w/o sudo
|
||||||
|
# ENV PIP_TARGET=/usr/local/pip-global
|
||||||
|
# ENV PYTHONPATH=${PIP_TARGET}:${PYTHONPATH}
|
||||||
|
# ENV PATH=${PIP_TARGET}/bin:${PATH}
|
||||||
|
# RUN mkdir -p ${PIP_TARGET} \
|
||||||
|
# && chown vscode:root ${PIP_TARGET} \
|
||||||
|
# && echo "if [ \"\$(stat -c '%U' ${PIP_TARGET})\" != \"vscode\" ]; then chown -R vscode:root ${PIP_TARGET}; fi" \
|
||||||
|
# | tee -a /root/.bashrc /home/vscode/.bashrc /root/.zshrc >> /home/vscode/.zshrc
|
||||||
|
|
||||||
|
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
|
||||||
|
# COPY requirements.txt /tmp/pip-tmp/
|
||||||
|
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
|
||||||
|
# && rm -rf /tmp/pip-tmp
|
||||||
|
|
||||||
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
|
# RUN apt-get update \
|
||||||
|
# && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
@ -0,0 +1,22 @@
|
|||||||
|
// Docu: https://containers.dev/implementors/json_reference/
|
||||||
|
{
|
||||||
|
"name": "Python 3",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile",
|
||||||
|
"context": "..",
|
||||||
|
//Update 'VARIANT' to pick a Python version: 3, 3.10, ...
|
||||||
|
"args": {
|
||||||
|
"VARIANT": "3.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"ms-python.python"
|
||||||
|
],
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
"postCreateCommand":
|
||||||
|
"python -m pip install --upgrade pip; pip install -r requirements-dev.txt; pip install -r requirements.txt",
|
||||||
|
"postStartCommand": "echo 'Happy coding'"
|
||||||
|
// Comment out to connect as root instead.
|
||||||
|
// "remoteUser": "vscode"
|
||||||
|
}
|
@ -1,12 +1,15 @@
|
|||||||
generated_python/__pycache__/
|
__pycache__/
|
||||||
qr/
|
qr/
|
||||||
venv/
|
venv/
|
||||||
|
|
||||||
*.csv
|
/*.csv
|
||||||
*.json
|
/*.json
|
||||||
!devbox.json
|
!devbox.json
|
||||||
!example_output.json
|
!example_output.json
|
||||||
!example_output.csv
|
!example_output.csv
|
||||||
!.github/
|
!.github/
|
||||||
!.flake8
|
!.flake8
|
||||||
|
.vscode
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
|
!.devcontainer/
|
||||||
|
!.devcontainer/*.json
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1 +0,0 @@
|
|||||||
wheel
|
|
@ -0,0 +1,4 @@
|
|||||||
|
wheel
|
||||||
|
pytest
|
||||||
|
flake8
|
||||||
|
pylint
|
Loading…
Reference in New Issue