diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ae238..e810a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +# [0.4.10] (2022-08-24) + +- Fixed an issue in **Install XSOAR local development environment** where dependency installation fails even though installation succeeded. +- Install `virtualenv` module in **Open integration/script in virtual environment** if the module is not installed. +- Installing **Demisto-SDK** globally will update it. + # [0.4.9] (2022-08-23) - Added installation and configuration of `pyenv` in **Install XSOAR local development environment**. diff --git a/README.md b/README.md index 2b75d86..a1bde17 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,8 @@ When working on an integration or a script, you can right click on it, and click This is the recommended way to develop and debug your integration. +> **_NOTE:_** The python version that used is the one that configured in the VSCode settings. To change the python version, [select a different python interpreter in VSCode](https://code.visualstudio.com/docs/python/environments#:~:text=By%20default%2C%20the%20Python%20extension,interpreter%2C%20it%20issues%20a%20warning.). + ## Dev Containers (Advanced) The extension supports opening an integration or a script in a dev container. diff --git a/Scripts/setup_dependencies.sh b/Scripts/setup_dependencies.sh index 78f48dc..2e55bfc 100755 --- a/Scripts/setup_dependencies.sh +++ b/Scripts/setup_dependencies.sh @@ -24,11 +24,11 @@ if [[ $dependencies == *"docker"* ]]; then brew install --cask docker || echo "Install Docker manually" fi -brew install $dependencies +brew install $dependencies || true if [[ $dependencies == *"pyenv"* ]]; then # If pyenv not already exists in zshrc, add it - if [ -f ~/.zshrc ] && [ -x "$(command -v pyenv)" ]; then + if [ -f ~/.zshrc ] && ! [ -x "$(command -v pyenv)" ]; then echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init -)"' >> ~/.zshrc @@ -36,7 +36,7 @@ if [[ $dependencies == *"pyenv"* ]]; then export PYENV_ROOT="$HOME/.pyenv"; export PATH="$PYENV_ROOT/bin":$PATH; - eval "$(pyenv init -)" || echo "No pyenv, procceding without"; + eval "$(pyenv init -)" # get latest python version from the pyenv list LATEST_PYTHON=$(pyenv install --list | grep --extended-regexp "^\s*[0-9][0-9.]*[0-9]\s*$" | tail -1); pyenv install "$LATEST_PYTHON" 2.7.18; diff --git a/Scripts/setup_venv.sh b/Scripts/setup_venv.sh index 8b90632..57316e6 100755 --- a/Scripts/setup_venv.sh +++ b/Scripts/setup_venv.sh @@ -27,6 +27,12 @@ docker run --name "${name}" "$testImage" 'pip list --format=freeze > /requiremen docker cp "${name}":/requirements.txt . docker rm -f "${name}" || true +# check if virtualenv module is installed +isVirtualEnvInstalled=true +$pythonPath -m virtualenv --version > /dev/null 2>&1 || isVirtualEnvInstalled=false +if [ "$isVirtualEnvInstalled" = "false" ]; then + $pythonPath -m pip install virtualenv +fi $pythonPath -m virtualenv -p python"${pythonVersion}" venv venv/bin/pip --version || (echo "No pip, check your python"${pythonVersion}" installation" && exit 1) while read line; do diff --git a/package-lock.json b/package-lock.json index 37282e5..b092c0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "xsoar", - "version": "0.4.9", + "version": "0.4.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "xsoar", - "version": "0.4.9", + "version": "0.4.10", "license": "SEE LICENSE IN LICENSE", "dependencies": { "envfile": "^6.17.0", diff --git a/package.json b/package.json index 0f30603..361478f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "xsoar", "displayName": "Cortex XSOAR", "description": "Build, Format, and Validate Cortex XSOAR with ease.", - "version": "0.4.9", + "version": "0.4.10", "engines": { "vscode": "^1.54.0" }, diff --git a/src/tools.ts b/src/tools.ts index a9c702d..455db0f 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -56,7 +56,7 @@ export async function installDemistoSDKLocally(): Promise { export async function installDemistoSDKGlobally(): Promise { // if pipx is installed no need to install pipx with pip - TerminalManager.sendText('pipx --version || pip install pipx && pipx ensurepath --force && pipx install demisto-sdk --force'); + TerminalManager.sendText('(pipx --version || pip install pipx) && pipx ensurepath --force && pipx install demisto-sdk --force && pipx upgrade demisto-sdk'); } export async function isDemistoSDKinstalled(): Promise {