refactor: move OasstApiClient into oasst-shared (#287)

* refactor: move api_client into oasst-shared

* refactor: move contract tests into oasst-shared

* fix: use new OasstApiClient imports in discord bot
This commit is contained in:
Jack Michaud
2023-01-02 21:13:20 +00:00
committed by GitHub
parent 0a59aeb8b0
commit ed115ea17c
7 changed files with 7 additions and 12 deletions
+3 -8
View File
@@ -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
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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
@@ -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
@@ -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 .