Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds devcontainer, and poetry for dependency management only #253

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG PYTHON_VERSION=3.11
FROM mcr.microsoft.com/devcontainers/python:${PYTHON_VERSION}

# update base
RUN apt-get update -y -qq
RUN apt-get dist-upgrade -y -qq
RUN apt-get autoremove -y -qq

# install pipx
RUN pip install --upgrade pip
RUN pip install pipx
RUN pipx ensurepath
RUN pipx install poetry flake8 pytest pylint
75 changes: 75 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
"name": "plexanisync devContainer",
"build": {
"dockerfile": "Dockerfile",
"args": {
"PYTHON_VERSION": "3.11"
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"plugins": "git zsh-syntax-highlighting zsh-autosuggestions poetry poetry-env gpg-agent pip",
"omzPlugins": "https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-autosuggestions"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"containerEnv": {
"GH_TOKEN": "${localEnv:GH_TOKEN}"
},
"mounts": [],
"postCreateCommand": "zsh .devcontainer/postCreateCommand.sh",
"customizations": {
"vscode": {
"settings": {
"editor.formatOnSave": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"files": {
"eol": "\n",
"trimTrailingWhitespace": true,
"trimTrailingWhitespaceInRegexAndStrings": true,
"insertFinalNewline": true
},
"vscode-yaml-sort.sortArrays": true,
"git": {
"enableCommitSigning": true,
"autofetch": true
},
"python": {
"analysis": {
"autoFormatStrings": true
},
"defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python",
"testing": {
"unittestEnabled": false,
"pytestEnabled": true,
"pytestArgs": [
"tests"
]
}
}
},
"extensions": [
"eamodio.gitlens",
"KevinRose.vsc-python-indent",
"ms-python.debugpy",
"ms-python.flake8",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance",
"mutantdino.resourcemonitor",
"njpwerner.autodocstring",
"njqdev.vscode-python-typehint",
"oderwat.indent-rainbow",
"VisualStudioExptTeam.vscodeintellicode"
]
}
}
}
10 changes: 10 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/zsh

# create venv in project, for use as default python interpreter. This also configures vscode extensions to use the poetry venv
poetry config virtualenvs.in-project true --local

# install dependencies
poetry install --no-interaction --no-ansi --quiet

# activate venv
source $(poetry env info --path)/bin/activate
Loading