From 7a3830d2286e78e2cf0500e924a3edf09fe480cd Mon Sep 17 00:00:00 2001 From: EduardDurech <39579228+EduardDurech@users.noreply.github.com> Date: Sat, 13 Jan 2024 06:29:07 +0100 Subject: [PATCH 1/2] Fixed Run from source instructions for Python Previously only installed dependencies but not pr_agent + Fixed link to OpenAI API Key and added for GitHub access token --- INSTALL.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index b7733cd4..a89810e4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -3,8 +3,8 @@ To get started with PR-Agent quickly, you first need to acquire two tokens: -1. An OpenAI key from [here](https://platform.openai.com/), with access to GPT-4. -2. A GitHub\GitLab\BitBucket personal access token (classic) with the repo scope. +1. An OpenAI key from [here](https://platform.openai.com/api-keys), with access to GPT-4. +2. A GitHub\GitLab\BitBucket personal access token (classic), with the repo scope. [GitHub from [here](https://github.com/settings/tokens)] There are several ways to use PR-Agent: @@ -79,10 +79,11 @@ codiumai/pr-agent@v0.9 git clone https://github.com/Codium-ai/pr-agent.git ``` -2. Install the requirements in your favorite virtual environment: +2. Navigate to the `/pr-agent` folder and install the requirements in your favorite virtual environment: +*Tip: make sure Rust is installed and in your `PATH`, instructions: https://rustup.rs* ``` -pip install -r requirements.txt +pip install -e . ``` 3. Copy the secrets template file and fill in your OpenAI key and your GitHub user token: @@ -93,10 +94,9 @@ chmod 600 pr_agent/settings/.secrets.toml # Edit .secrets.toml file ``` -4. Add the pr_agent folder to your PYTHONPATH, then run the cli.py script: +4. Run the cli.py script: ``` -export PYTHONPATH=[$PYTHONPATH:] python3 -m pr_agent.cli --pr_url review python3 -m pr_agent.cli --pr_url ask python3 -m pr_agent.cli --pr_url describe @@ -107,6 +107,11 @@ python3 -m pr_agent.cli --issue_url similar_issue ... ``` +[Optional] Add the pr_agent folder to your PYTHONPATH +``` +export PYTHONPATH=$PYTHONPATH: +``` + --- ### Run as a GitHub Action From a58c385b0febfc5465f9854016475310c9137f24 Mon Sep 17 00:00:00 2001 From: EduardDurech <39579228+EduardDurech@users.noreply.github.com> Date: Sun, 14 Jan 2024 04:16:32 +0100 Subject: [PATCH 2/2] Fixed Rust warning tip as behaviour is inconsistent --- INSTALL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index a89810e4..d06b744d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -81,11 +81,12 @@ git clone https://github.com/Codium-ai/pr-agent.git 2. Navigate to the `/pr-agent` folder and install the requirements in your favorite virtual environment: -*Tip: make sure Rust is installed and in your `PATH`, instructions: https://rustup.rs* ``` pip install -e . ``` +*Note: If you get an error related to Rust in the dependency installation then make sure Rust is installed and in your `PATH`, instructions: https://rustup.rs* + 3. Copy the secrets template file and fill in your OpenAI key and your GitHub user token: ```