diff --git a/.github/workflows/test-api-contract.yaml b/.github/workflows/test-api-contract.yaml index e75e5375..3707f4de 100644 --- a/.github/workflows/test-api-contract.yaml +++ b/.github/workflows/test-api-contract.yaml @@ -18,18 +18,13 @@ jobs: - run: cd oasst-shared && pip install -e . + - run: cd oasst-shared && pip install -r requirements.dev.txt + - run: cd backend && pip install -r requirements.txt - - run: cd discord-bot && pip install -r requirements.txt - - - run: cd discord-bot && pip install -r requirements.dev.txt - - run: ./scripts/backend-development/start-mock-server.sh - # runs the contract tests. currently the api client is - # found in the discord bot code, but this should be updated - # once the client moves into oasst-shared. - name: Run contract tests - run: ./scripts/discord-bot-development/test.sh + run: ./scripts/oasst-shared-development/test.sh - run: ./scripts/backend-development/stop-mock-server.sh diff --git a/discord-bot/bot/bot.py b/discord-bot/bot/bot.py index 35a3fb23..df3c5f2f 100644 --- a/discord-bot/bot/bot.py +++ b/discord-bot/bot/bot.py @@ -5,9 +5,9 @@ import aiosqlite import hikari import lightbulb import miru -from bot.api_client import OasstApiClient from bot.settings import Settings from bot.utils import EMPTY, mention +from oasst_shared.api_client import OasstApiClient settings = Settings() diff --git a/discord-bot/bot/extensions/work.py b/discord-bot/bot/extensions/work.py index 767e05ac..19802c64 100644 --- a/discord-bot/bot/extensions/work.py +++ b/discord-bot/bot/extensions/work.py @@ -8,10 +8,10 @@ import lightbulb import lightbulb.decorators import miru from aiosqlite import Connection -from bot.api_client import OasstApiClient, TaskType from bot.db.schemas import GuildSettings from bot.utils import EMPTY from loguru import logger +from oasst_shared.api_client import OasstApiClient, TaskType from oasst_shared.schemas import protocol as protocol_schema from oasst_shared.schemas.protocol import TaskRequestType diff --git a/discord-bot/bot/api_client.py b/oasst-shared/oasst_shared/api_client.py similarity index 100% rename from discord-bot/bot/api_client.py rename to oasst-shared/oasst_shared/api_client.py diff --git a/discord-bot/requirements.dev.txt b/oasst-shared/requirements.dev.txt similarity index 100% rename from discord-bot/requirements.dev.txt rename to oasst-shared/requirements.dev.txt diff --git a/discord-bot/tests/test_oasst_api_client.py b/oasst-shared/tests/test_oasst_api_client.py similarity index 97% rename from discord-bot/tests/test_oasst_api_client.py rename to oasst-shared/tests/test_oasst_api_client.py index 9b0ff383..be757e8f 100644 --- a/discord-bot/tests/test_oasst_api_client.py +++ b/oasst-shared/tests/test_oasst_api_client.py @@ -1,7 +1,7 @@ from uuid import uuid4 import pytest -from bot.api_client import OasstApiClient +from oasst_shared.api_client import OasstApiClient from oasst_shared.schemas import protocol as protocol_schema diff --git a/scripts/discord-bot-development/test.sh b/scripts/oasst-shared-development/test.sh similarity index 76% rename from scripts/discord-bot-development/test.sh rename to scripts/oasst-shared-development/test.sh index a45adf00..e9324196 100755 --- a/scripts/discord-bot-development/test.sh +++ b/scripts/oasst-shared-development/test.sh @@ -2,7 +2,7 @@ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # switch to backend directory -pushd "$parent_path/../../discord-bot" +pushd "$parent_path/../../oasst-shared" pytest .