generated from coulomb/repo-seed
feat: import core schemas from hub-core
This commit is contained in:
@@ -1,30 +1,7 @@
|
|||||||
import uuid
|
from hub_core.schemas.agent_message import MessageCreate, MessageRead, MessageReply
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from pydantic import BaseModel, ConfigDict
|
__all__ = [
|
||||||
|
"MessageCreate",
|
||||||
|
"MessageRead",
|
||||||
class MessageCreate(BaseModel):
|
"MessageReply",
|
||||||
from_agent: str
|
]
|
||||||
to_agent: str
|
|
||||||
subject: str
|
|
||||||
body: str
|
|
||||||
thread_id: uuid.UUID | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class MessageReply(BaseModel):
|
|
||||||
from_agent: str
|
|
||||||
body: str
|
|
||||||
|
|
||||||
|
|
||||||
class MessageRead(BaseModel):
|
|
||||||
model_config = ConfigDict(from_attributes=True)
|
|
||||||
id: uuid.UUID
|
|
||||||
from_agent: str
|
|
||||||
to_agent: str
|
|
||||||
subject: str
|
|
||||||
body: str
|
|
||||||
thread_id: uuid.UUID | None = None
|
|
||||||
read_at: datetime | None = None
|
|
||||||
archived_at: datetime | None = None
|
|
||||||
created_at: datetime
|
|
||||||
|
|||||||
@@ -1,29 +1,7 @@
|
|||||||
from pydantic import BaseModel
|
from hub_core.schemas.doi import DoICriterion, DoIReport, DoISummaryEntry
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
class DoICriterion(BaseModel):
|
"DoICriterion",
|
||||||
id: str
|
"DoIReport",
|
||||||
label: str
|
"DoISummaryEntry",
|
||||||
tier: str
|
]
|
||||||
status: str # pass | fail | warn | skip
|
|
||||||
detail: str = ""
|
|
||||||
|
|
||||||
|
|
||||||
class DoIReport(BaseModel):
|
|
||||||
repo_slug: str
|
|
||||||
tier: str # none | core | standard | full
|
|
||||||
core_pass: bool
|
|
||||||
standard_pass: bool
|
|
||||||
full_pass: bool
|
|
||||||
criteria: list[DoICriterion] = []
|
|
||||||
checked_at: str
|
|
||||||
|
|
||||||
|
|
||||||
class DoISummaryEntry(BaseModel):
|
|
||||||
repo_slug: str
|
|
||||||
domain_slug: str | None
|
|
||||||
tier: str
|
|
||||||
core_pass: bool
|
|
||||||
standard_pass: bool
|
|
||||||
full_pass: bool
|
|
||||||
checked_at: str
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ dependencies = [
|
|||||||
"llm-connect",
|
"llm-connect",
|
||||||
"pyyaml>=6.0.3",
|
"pyyaml>=6.0.3",
|
||||||
"nats-py>=2.7.0",
|
"nats-py>=2.7.0",
|
||||||
|
"hub-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
@@ -34,6 +35,7 @@ artifacts = ["custodian_cli.py", "statehub_register.py"]
|
|||||||
|
|
||||||
[tool.uv.sources]
|
[tool.uv.sources]
|
||||||
llm-connect = { path = "/home/worsch/llm-connect", editable = true }
|
llm-connect = { path = "/home/worsch/llm-connect", editable = true }
|
||||||
|
hub-core = { path = "/home/worsch/hub-core", editable = true }
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
asyncio_mode = "auto"
|
asyncio_mode = "auto"
|
||||||
|
|||||||
12
tests/test_hub_core_imports.py
Normal file
12
tests/test_hub_core_imports.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from api.schemas.agent_message import MessageCreate
|
||||||
|
from api.schemas.doi import DoIReport
|
||||||
|
from hub_core.schemas.agent_message import MessageCreate as CoreMessageCreate
|
||||||
|
from hub_core.schemas.doi import DoIReport as CoreDoIReport
|
||||||
|
|
||||||
|
|
||||||
|
def test_state_hub_reexports_core_message_schema() -> None:
|
||||||
|
assert MessageCreate is CoreMessageCreate
|
||||||
|
|
||||||
|
|
||||||
|
def test_state_hub_reexports_core_doi_schema() -> None:
|
||||||
|
assert DoIReport is CoreDoIReport
|
||||||
23
uv.lock
generated
23
uv.lock
generated
@@ -530,6 +530,27 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960 },
|
{ url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960 },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hub-core"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = { editable = "../hub-core" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "fastapi" },
|
||||||
|
{ name = "fastmcp" },
|
||||||
|
{ name = "httpx" },
|
||||||
|
{ name = "pydantic" },
|
||||||
|
{ name = "sqlalchemy", extra = ["asyncio"] },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
requires-dist = [
|
||||||
|
{ name = "fastapi", specifier = ">=0.115.0" },
|
||||||
|
{ name = "fastmcp", specifier = ">=2.0.0" },
|
||||||
|
{ name = "httpx", specifier = ">=0.28.0" },
|
||||||
|
{ name = "pydantic", specifier = ">=2.10.0" },
|
||||||
|
{ name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.0" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "3.11"
|
version = "3.11"
|
||||||
@@ -1443,6 +1464,7 @@ dependencies = [
|
|||||||
{ name = "fastapi" },
|
{ name = "fastapi" },
|
||||||
{ name = "fastmcp" },
|
{ name = "fastmcp" },
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
|
{ name = "hub-core" },
|
||||||
{ name = "llm-connect" },
|
{ name = "llm-connect" },
|
||||||
{ name = "nats-py" },
|
{ name = "nats-py" },
|
||||||
{ name = "psycopg2-binary" },
|
{ name = "psycopg2-binary" },
|
||||||
@@ -1468,6 +1490,7 @@ requires-dist = [
|
|||||||
{ name = "fastapi", specifier = ">=0.115.0" },
|
{ name = "fastapi", specifier = ">=0.115.0" },
|
||||||
{ name = "fastmcp", specifier = ">=2.0.0" },
|
{ name = "fastmcp", specifier = ">=2.0.0" },
|
||||||
{ name = "httpx", specifier = ">=0.28.0" },
|
{ name = "httpx", specifier = ">=0.28.0" },
|
||||||
|
{ name = "hub-core", editable = "../hub-core" },
|
||||||
{ name = "llm-connect", editable = "../llm-connect" },
|
{ name = "llm-connect", editable = "../llm-connect" },
|
||||||
{ name = "nats-py", specifier = ">=2.7.0" },
|
{ name = "nats-py", specifier = ">=2.7.0" },
|
||||||
{ name = "psycopg2-binary", specifier = ">=2.9.0" },
|
{ name = "psycopg2-binary", specifier = ">=2.9.0" },
|
||||||
|
|||||||
Reference in New Issue
Block a user