From 570f61de5a404559b4ff69eb5cd2fa216e70e872 Mon Sep 17 00:00:00 2001 From: LangLangBart <92653266+LangLangBart@users.noreply.github.com> Date: Wed, 25 Oct 2023 18:59:10 +0200 Subject: [PATCH] fix: minor issues (#581) * fix: minor issues * chore: poetry lock --no-update * chore: write stdout and stderr in failed "npm build" * chore: remove redundant lines in prepackage.js * fix: Added stdout and stderr outputs to error handling in install_from_source.py --- .../docs/customization/other-configuration.md | 2 +- docs/docs/how-continue-works.md | 2 +- extensions/intellij/README.md | 2 +- .../vscode/scripts/install_from_source.py | 29 +++++++++---------- extensions/vscode/scripts/prepackage.js | 12 ++++---- server/poetry.lock | 18 ++---------- 6 files changed, 26 insertions(+), 39 deletions(-) diff --git a/docs/docs/customization/other-configuration.md b/docs/docs/customization/other-configuration.md index bd21140a3..7be6d04ad 100644 --- a/docs/docs/customization/other-configuration.md +++ b/docs/docs/customization/other-configuration.md @@ -1,7 +1,7 @@ --- title: Other Configuration description: Swap out different LLM providers -keywords: [tempature, custom policies, custom system messsage] +keywords: [temperature, custom policies, custom system message] --- # Other Configuration diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index b2cb93ac0..6cd35ac29 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -1,6 +1,6 @@ --- title: How Continue works -description: Overview of the Continue archictecture +description: Overview of the Continue architecture keywords: [architecture, vs code, jetbrains, ide, manually] --- diff --git a/extensions/intellij/README.md b/extensions/intellij/README.md index 09e31939d..981ecd97a 100644 --- a/extensions/intellij/README.md +++ b/extensions/intellij/README.md @@ -2,7 +2,7 @@ **[Continue](https://continue.dev/docs) is the open-source autopilot for software development—an extension that brings the power of ChatGPT to your IDE** -### Get possible explainations +### Get possible explanations Ask Continue about a part of your code to get another perspective diff --git a/extensions/vscode/scripts/install_from_source.py b/extensions/vscode/scripts/install_from_source.py index 5758e7103..dc153fdc2 100644 --- a/extensions/vscode/scripts/install_from_source.py +++ b/extensions/vscode/scripts/install_from_source.py @@ -31,33 +31,33 @@ def main(): # Clear out old stuff build_directory = "../build" remove_existing_vsix_files(build_directory) - run("rm ../server/continuedev-0.1.2-py3-none-any.whl", True) + run("rm ../../../server/continuedev-0.1.2-py3-none-any.whl", True) # Check for Python and Node - we won't install them, but will warn resp1 = run("python --version") resp2 = run("python3 --version") - if resp1.stderr and resp2.stderr: + if resp1.returncode != 0 and resp2.returncode != 0: print( "Python is required for Continue but is not installed on your machine. See https://www.python.org/downloads/ to download the latest version, then try again." ) return resp = run("node --version") - if resp.stderr: + if resp.returncode != 0: print( "Node is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again." ) return resp = run("npm --version") - if resp.stderr: + if resp.returncode != 0: print( "NPM is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again." ) return resp = run("poetry --version") - if resp.stderr: + if resp.returncode != 0: print( "Poetry is required for Continue but is not installed on your machine. See https://python-poetry.org/docs/#installation to download the latest version, then try again." ) @@ -74,20 +74,19 @@ def main(): break if not editor_cmd: - print( - "No code editor command is available. Please install a code editor and try again." - ) + print("No code editor command is available. Please install a code editor and try again.") return - resp = run("cd ../../continuedev; poetry install; poetry run typegen") + resp = run("cd ../../../server; poetry install; poetry run typegen") + if resp.returncode != 0: + print("Error running the poetry commands. Please try again.") + return - resp = run( - "cd ../../..; npm i; cd gui; npm i; cd ../extensions/vscode; npm run package" - ) - - if resp.stderr: + resp = run("cd ..; npm i; cd gui; npm i; cd ..; npm run package", True) + if resp.returncode != 0: print("Error packaging the extension. Please try again.") - print("This was the error: ", resp.stderr) + print("stdout: ", resp.stdout.decode()) + print("stderr: ", resp.stderr.decode()) return run( diff --git a/extensions/vscode/scripts/prepackage.js b/extensions/vscode/scripts/prepackage.js index 3a17af781..9838d4931 100644 --- a/extensions/vscode/scripts/prepackage.js +++ b/extensions/vscode/scripts/prepackage.js @@ -21,7 +21,13 @@ exec("npm install", (error) => { if (error) throw error; console.log("npm install in gui completed"); - exec("npm run build", (error) => { + exec("npm run build", (error, stdout, stderr) => { + if (error) { + console.log("Error running npm run build in gui"); + console.log("stdout: ", stdout); + console.log("stderr: ", stderr); + throw error; + } // Then copy over the dist folder to the Intellij extension const intellijExtensionWebviewPath = path.join( "..", @@ -71,10 +77,6 @@ exec("npm install", (error) => { console.log("Copied gui build to VSCode extension"); }); - if (error) { - console.log("Error running npm run build in gui: ", error); - throw error; - } if (!fs.existsSync(path.join("dist", "assets", "index.js"))) { throw new Error("gui build did not produce index.js"); } diff --git a/server/poetry.lock b/server/poetry.lock index 9811f2cb7..2afc4d9f3 100644 --- a/server/poetry.lock +++ b/server/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -2290,20 +2290,6 @@ files = [ [package.dependencies] mpmath = ">=0.19" -[[package]] -name = "tenacity" -version = "8.2.3" -description = "Retry code until it succeeds" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tenacity-8.2.3-py3-none-any.whl", hash = "sha256:ce510e327a630c9e1beaf17d42e6ffacc88185044ad85cf74c0a8887c6a0f88c"}, - {file = "tenacity-8.2.3.tar.gz", hash = "sha256:5398ef0d78e63f40007c1fb4c0bff96e1911394d2fa8d194f77619c05ff6cc8a"}, -] - -[package.extras] -doc = ["reno", "sphinx", "tornado (>=4.5)"] - [[package]] name = "tiktoken" version = "0.4.0" @@ -3049,4 +3035,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "7a5cc2f989f9bb12ed7735355fbe27d1fc590edde5bb9727dfc6f9898b0d2254" +content-hash = "3cb831bcd0ce1c9cb2e1c353a0a7449fe0afe4ad8e1c3de2e806c27e80366207"