mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-02 17:00:28 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
-1
@@ -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 .
|
||||
|
||||
Reference in New Issue
Block a user