From ee4798accaf1f8050410ba3634d278d765e41b5e Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sat, 23 Mar 2024 16:16:32 +0200 Subject: [PATCH] adjustments to pypi --- docs/docs/installation/locally.md | 6 +----- pr_agent/cli.py | 7 +++++++ pr_agent/cli_pip.py | 9 +-------- pyproject.toml | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/docs/installation/locally.md b/docs/docs/installation/locally.md index e493862ad..123a6c033 100644 --- a/docs/docs/installation/locally.md +++ b/docs/docs/installation/locally.md @@ -27,12 +27,8 @@ def main(): get_settings().set("openai.key", openai_key) get_settings().set("github.user_token", user_token) - # Preparing the command - run_command = f"--pr_url={pr_url} {command.lstrip('/')}" - args = cli.set_parser().parse_args(run_command.split()) - # Run the command. Feedback will appear in GitHub PR comments - cli.run(args=args) + cli.run_command(pr_url, command) if __name__ == '__main__': diff --git a/pr_agent/cli.py b/pr_agent/cli.py index 53feeb74e..88759e167 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -50,6 +50,13 @@ def set_parser(): parser.add_argument('rest', nargs=argparse.REMAINDER, default=[]) return parser +def run_command(pr_url, command): + # Preparing the command + run_command = f"--pr_url={pr_url} {command.lstrip('/')}" + args = set_parser().parse_args(run_command.split()) + + # Run the command. Feedback will appear in GitHub PR comments + run(args=args) def run(inargs=None, args=None): parser = set_parser() diff --git a/pr_agent/cli_pip.py b/pr_agent/cli_pip.py index cdab37e94..caa56f0c9 100644 --- a/pr_agent/cli_pip.py +++ b/pr_agent/cli_pip.py @@ -1,8 +1,5 @@ from pr_agent import cli from pr_agent.config_loader import get_settings -from pr_agent.log import setup_logger - -setup_logger() def main(): @@ -18,12 +15,8 @@ def main(): get_settings().set("openai.key", openai_key) get_settings().set("github.user_token", user_token) - # Preparing the command - run_command = f"--pr_url={pr_url} {command.lstrip('/')}" - args = cli.set_parser().parse_args(run_command.split()) - # Run the command. Feedback will appear in GitHub PR comments - cli.run(args=args) + cli.run_command(pr_url, command) if __name__ == '__main__': diff --git a/pyproject.toml b/pyproject.toml index f4be63714..651d8a4f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pr-agent" -version = "0.2.0" +version = "0.2.1" authors = [{name= "CodiumAI", email = "tal.r@codium.ai"}]