Skip to content

Commit

Permalink
Make BuildArtifactType use str mixin to allow Settings can serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
peytondmurray committed Nov 16, 2024
1 parent 7683abd commit 5e0f61a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions conda-store-server/conda_store_server/_internal/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class Specification(BaseModel):
model_config = ConfigDict(from_attributes=True)


class BuildArtifactType(enum.Enum):
# Use str mixin to allow pydantic to serialize Settings models
class BuildArtifactType(str, enum.Enum):
DIRECTORY = "DIRECTORY"
LOCKFILE = "LOCKFILE"
LOGS = "LOGS"
Expand Down Expand Up @@ -364,8 +365,6 @@ class Settings(BaseModel):
metadata={"global": False},
)

model_config = ConfigDict(use_enum_values=True)


PipArg = Annotated[str, AfterValidator(lambda v: check_pip(v))]

Expand Down
2 changes: 1 addition & 1 deletion conda-store-server/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_conda_store_register_environment_workflow(

build = api.get_build(db, build_id=build_id)
assert build is not None
assert build.status == schema.BuildStatus.QUEUED
assert build.status in [schema.BuildStatus.QUEUED, schema.BuildStatus.COMPLETED]
assert build.environment.name == simple_specification.name
assert build.environment.namespace.name == namespace_name
assert build.specification.spec["name"] == simple_specification.name
Expand Down

0 comments on commit 5e0f61a

Please sign in to comment.