dev env in vscode

This commit is contained in:
Florian du Garage Num 2023-10-27 17:28:20 +02:00
parent ee6fc01441
commit c1ac5cf95e
4 changed files with 19 additions and 4 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
geany/ mkdocs-material
mkdocs-material/
docs/draft docs/draft
public public
venv

2
.vscode/tasks.json vendored
View File

@ -4,7 +4,7 @@
{ {
"label": "install-dependencies", "label": "install-dependencies",
"type": "shell", "type": "shell",
"command": "pip install -r requirements.txt", "command": "./create_venv.sh",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true

15
create_venv.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# Read configurations from pyvenv.cfg
home=$(awk -F' = ' '$1=="home"{print $2}' pyvenv.cfg)
executable=$(awk -F' = ' '$1=="executable"{print $2}' pyvenv.cfg)
version=$(awk -F' = ' '$1=="version"{print $2}' pyvenv.cfg)
# Check if venv exists, if not, create it using the details from pyenv.cfg
if [ ! -d "venv" ]; then
$executable -m venv venv
fi
# Install requirements
venv/bin/python -m pip install --upgrade pip
venv/bin/python -m pip install -r requirements.txt

View File

@ -2,4 +2,4 @@ home = /usr/bin
include-system-site-packages = false include-system-site-packages = false
version = 3.11.2 version = 3.11.2
executable = /usr/bin/python3.11 executable = /usr/bin/python3.11
command = /usr/bin/python3 -m venv /home/greg/workspace/doc command = /usr/bin/python3 -m venv ./venv