From 2db2cdc1ff51f1959492b2f55c77765f83a84643 Mon Sep 17 00:00:00 2001 From: Terminator Date: Thu, 30 Nov 2023 00:14:57 -0300 Subject: [PATCH] feat: add vscode debugger --- .vscode/launch.json | 16 ++++++++++++++++ .vscode/tasks.json | 12 ++++++++++++ activate_env.py | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 activate_env.py diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..867839f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Debug Main.py", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/src/main.py", + "console": "integratedTerminal", + "env": { + "PYTHONPATH": "${workspaceFolder}" + }, + "preLaunchTask": "Setup Environment", + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..adfbdac --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,12 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Setup Environment", + "type": "shell", + "command": "python", + "args": ["activate_env.py"], + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/activate_env.py b/activate_env.py new file mode 100644 index 0000000..6f0aa15 --- /dev/null +++ b/activate_env.py @@ -0,0 +1,9 @@ +import subprocess +import os + +# Ativa o ambiente virtual +subprocess.run([r'.\venv\Scripts\activate.bat'], shell=True) + +# Configura as variáveis de ambiente +os.environ['PATH'] = r'.\bin;' + os.environ['PATH'] +os.environ['PYTHONUTF8'] = '1' \ No newline at end of file