Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
build: Update all actions to use cached poetry builds (#846)
RT61897921fdb5
diff --git a/.github/workflows/black_format.yml b/.github/workflows/black_format.ymlindex e381ee8af..7e5bcce77 100644--- a/.github/workflows/black_format.yml+++ b/.github/workflows/black_format.yml@@ -13,22 +13,12 @@ jobs:- name: Checkout codeuses: actions/checkout@v4- - name: Set up Python- uses: actions/setup-python@v4+ - name: "Setup Python, Poetry and Dependencies"+ uses: packetcoders/action-setup-cache-python-poetry@mainwith:python-version: "3.11"-- - name: Install poetry- run: pip install poetry-- - name: Set Poetry config- run: |- poetry config virtualenvs.in-project false- poetry config virtualenvs.path ~/.virtualenvs-- - name: Install dependencies using Poetry- run: |- poetry install -E dev+ poetry-version: "1.7.1"+ install-args: "-E dev" # TODO: change this to --group dev when PR #842 lands- name: Run Blackrun: poetry run black --check . -l 140diff --git a/.github/workflows/main.yml b/.github/workflows/main.ymlindex 7fd915872..fac169d79 100644--- a/.github/workflows/main.yml+++ b/.github/workflows/main.yml@@ -8,21 +8,17 @@ on:jobs:check_main:runs-on: ubuntu-latest-steps:- name: Checkout codeuses: actions/checkout@v4- - name: Set up Python- uses: actions/setup-python@v2+ - name: "Setup Python, Poetry and Dependencies"+ uses: packetcoders/action-setup-cache-python-poetry@mainwith:- python-version: '3.10.10' # Use the version of Python you need-- - name: Install dependencies- run: |- python -m pip install --upgrade pip- pip install -e .+ python-version: "3.11"+ poetry-version: "1.7.1"+ install-args: "--all-extras"- name: Run main.py with inputrun: |- echo -e "\n\n\nn" | python main.py+ echo -e "\n\n\nn" | poetry run python main.pydiff --git a/.github/workflows/poetry-publish-nightly.yml b/.github/workflows/poetry-publish-nightly.ymlindex be4822560..357c04a93 100644--- a/.github/workflows/poetry-publish-nightly.yml+++ b/.github/workflows/poetry-publish-nightly.yml@@ -29,14 +29,13 @@ jobs:steps:- name: Check out the repositoryuses: actions/checkout@v4- - name: Set up Python- uses: actions/setup-python@v2++ - name: "Setup Python, Poetry and Dependencies"+ uses: packetcoders/action-setup-cache-python-poetry@mainwith:- python-version: 3.11- - name: Install poetry- run: |- curl -sSL https://install.python-poetry.org | python3 -- echo "$HOME/.local/bin" >> $GITHUB_PATH+ python-version: "3.11"+ poetry-version: "1.7.1"+- name: Set release versionrun: |# Extract the version number from pyproject.toml using awk@@ -49,12 +48,14 @@ jobs:sed -i "s/__version__ = '.*'/__version__ = '${NIGHTLY_VERSION}'/g" memgpt/__init__.pycat pyproject.tomlcat memgpt/__init__.py+- name: Configure poetry- run: |- poetry config pypi-token.pypi ${{ secrets.PYPI_NIGHTLY_TOKEN }}+ env:+ PYPI_NIGHTLY_TOKEN: ${{ secrets.PYPI_NIGHTLY_TOKEN }}+ run: poetry config pypi-token.pypi "$PYPI_NIGHTLY_TOKEN"+- name: Build the Python packagerun: poetry build+- name: Publish the package to PyPI- run: poetry publish- env:- POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_NIGHTLY_TOKEN }}+ run: poetry publish\ No newline at end of filediff --git a/.github/workflows/poetry-publish.yml b/.github/workflows/poetry-publish.ymlindex f16b1af03..6e3d9ecbe 100644--- a/.github/workflows/poetry-publish.yml+++ b/.github/workflows/poetry-publish.yml@@ -11,20 +11,21 @@ jobs:steps:- name: Check out the repositoryuses: actions/checkout@v4- - name: Set up Python- uses: actions/setup-python@v2++ - name: "Setup Python, Poetry and Dependencies"+ uses: packetcoders/action-setup-cache-python-poetry@mainwith:- python-version: 3.11- - name: Install poetry- run: |- curl -sSL https://install.python-poetry.org | python3 -- echo "$HOME/.local/bin" >> $GITHUB_PATH+ python-version: "3.11"+ poetry-version: "1.7.1"+- name: Configure poetry+ env:+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}run: |- poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}+ poetry config pypi-token.pypi "$PYPI_TOKEN"+- name: Build the Python packagerun: poetry build+- name: Publish the package to PyPI- run: poetry publish- env:- POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}+ run: poetry publish\ No newline at end of filediff --git a/.github/workflows/rdme-openapi.yml b/.github/workflows/rdme-openapi.ymlindex e5755eae3..a8c942da1 100644--- a/.github/workflows/rdme-openapi.yml+++ b/.github/workflows/rdme-openapi.yml@@ -17,27 +17,12 @@ jobs:- name: Check out repo 📚uses: actions/checkout@v4- - name: Set up Python- uses: actions/setup-python@v4+ - name: "Setup Python, Poetry and Dependencies"+ uses: packetcoders/action-setup-cache-python-poetry@mainwith:python-version: "3.11"-- - name: Install poetry- run: pip install poetry-- - name: Set Poetry config- run: |- poetry config virtualenvs.in-project false- poetry config virtualenvs.path ~/.virtualenvs-- - name: Install dependencies using Poetry- run: |- poetry install --all-extras-- - name: Set Poetry config- run: |- poetry config virtualenvs.in-project false- poetry config virtualenvs.path ~/.virtualenvs+ poetry-version: "1.7.1"+ install-args: "--all-extras"- name: Generate openapi.json filerun: |diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex 4bd4e95a6..8b6284fb7 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -12,15 +12,8 @@ on:jobs:test:-runs-on: ubuntu-latest-- env:- PGVECTOR_TEST_DB_URL: postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt- OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}-timeout-minutes: 15-steps:- name: Checkoutuses: actions/checkout@v4@@ -33,26 +26,18 @@ jobs:with:python-version: "3.11"poetry-version: "1.7.1"-- - name: Set Poetry config- run: |- poetry config virtualenvs.in-project false- poetry config virtualenvs.path ~/.virtualenvs-- - name: Install dependencies using Poetry- run: |- poetry install --all-extras+ install-args: "--all-extras"- name: Run tests with pytestenv:PGVECTOR_TEST_DB_URL: postgresql+pg8000://memgpt:memgpt@localhost:8888/memgptOPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}run: |- PGVECTOR_TEST_DB_URL=postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} poetry run pytest -s -vv -k "not test_storage" tests+ poetry run pytest -s -vv -k "not test_storage" tests- name: Run storage testsenv:PGVECTOR_TEST_DB_URL: postgresql+pg8000://memgpt:memgpt@localhost:8888/memgptOPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}run: |- PGVECTOR_TEST_DB_URL=postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} poetry run pytest -s -vv tests/test_storage.py+ poetry run pytest -s -vv tests/test_storage.pydiff --git a/tests/test_cli.py b/tests/test_cli.pyindex 19e3dc5a0..37e03dce4 100644--- a/tests/test_cli.py+++ b/tests/test_cli.py@@ -21,7 +21,7 @@ def test_save_load():else:client = MemGPT(quickstart="memgpt_hosted")- child = pexpect.spawn("memgpt run --agent test_save_load --first --strip-ui")+ child = pexpect.spawn("poetry run memgpt run --agent test_save_load --first --strip-ui")child.expect("Enter your message:", timeout=TIMEOUT)child.sendline()@@ -37,7 +37,7 @@ def test_save_load():assert child.isalive() is False, "CLI should have terminated."assert child.exitstatus == 0, "CLI did not exit cleanly."- child = pexpect.spawn("memgpt run --agent test_save_load --first --strip-ui")+ child = pexpect.spawn("poetry run memgpt run --agent test_save_load --first --strip-ui")child.expect("Using existing agent test_save_load", timeout=TIMEOUT)child.expect("Enter your message:", timeout=TIMEOUT)child.sendline("/exit")