From e18df47cee14cde58584ffc1a8bbb2606b6f4102 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 31 Jul 2023 22:27:08 -0700 Subject: ci: :green_heart: fix file structure for pyinstaller, main.yaml updates --- .github/workflows/main.yaml | 27 ++++++++++++++-------- continuedev/main.py | 5 ++++ .../src/continuedev/libs/util/count_tokens.py | 1 + continuedev/src/run.py | 4 ---- run.py | 4 ++++ 5 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 continuedev/main.py delete mode 100644 continuedev/src/run.py create mode 100644 run.py diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6642d5c0..1d5f2cbc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,14 +18,23 @@ jobs: - name: Check-out repository uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" # Version range or exact version of a Python version to use, using SemVer's version range syntax - architecture: "x64" # optional x64 or x86. Defaults to x64 if not specified - cache: "pip" - cache-dependency-path: | - **/requirements*.txt + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + + - name: Install Python dependencies + run: | + cd continuedev + poetry install + + # - name: Setup Python + # uses: actions/setup-python@v4 + # with: + # python-version: "3.10" # Version range or exact version of a Python version to use, using SemVer's version range syntax + # architecture: "x64" # optional x64 or x86. Defaults to x64 if not specified + # cache: "pip" + # cache-dependency-path: | + # **/requirements*.txt - name: Install Dependencies run: | @@ -35,7 +44,7 @@ jobs: uses: Nuitka/Nuitka-Action@main with: nuitka-version: main - script-name: kasa_cli + script-name: continuedev/src/run.py onefile: true - name: Upload Artifacts diff --git a/continuedev/main.py b/continuedev/main.py new file mode 100644 index 00000000..3cf4e817 --- /dev/null +++ b/continuedev/main.py @@ -0,0 +1,5 @@ +from .src.continuedev.server.main import run_server + + +def main(): + run_server() diff --git a/continuedev/src/continuedev/libs/util/count_tokens.py b/continuedev/src/continuedev/libs/util/count_tokens.py index 6add7b1a..3b594036 100644 --- a/continuedev/src/continuedev/libs/util/count_tokens.py +++ b/continuedev/src/continuedev/libs/util/count_tokens.py @@ -3,6 +3,7 @@ from typing import Dict, List, Union from ...core.main import ChatMessage from .templating import render_templated_string from ...libs.llm import LLM +from tiktoken_ext import openai_public import tiktoken # TODO move many of these into specific LLM.properties() function that diff --git a/continuedev/src/run.py b/continuedev/src/run.py deleted file mode 100644 index 089cc54d..00000000 --- a/continuedev/src/run.py +++ /dev/null @@ -1,4 +0,0 @@ -from continuedev.server.main import run_server - -if __name__ == "__main__": - run_server() diff --git a/run.py b/run.py new file mode 100644 index 00000000..7160bbc7 --- /dev/null +++ b/run.py @@ -0,0 +1,4 @@ +from continuedev.main import main + +if __name__ == "__main__": + main() -- cgit v1.2.3-70-g09d2