Skip to content

Commit 308c45f

Browse files
committed
refactor: remove pydantic usage
1 parent bb53f45 commit 308c45f

File tree

3 files changed

+7
-113
lines changed

3 files changed

+7
-113
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies = [
1818
"attrs>=25.3.0",
1919
"loguru>=0.7.3",
2020
"lsprotocol>=2025.0.0",
21-
"pydantic>=2.11.7",
2221
"semver>=3.0.4",
2322
"tenacity>=9.1.2",
2423
]

src/lsp_client/server/container.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
from collections.abc import AsyncGenerator
44
from contextlib import asynccontextmanager
55
from pathlib import Path
6-
from typing import Annotated, Literal, final, override
6+
from typing import Literal, final, override
77

88
from attrs import Factory, define, field
99
from loguru import logger
10-
from pydantic import BaseModel, Field
1110

1211
from lsp_client.jsonrpc.parse import RawPackage
1312
from lsp_client.utils.workspace import Workspace
@@ -16,7 +15,8 @@
1615
from .local import LocalServer
1716

1817

19-
class MountBase(BaseModel):
18+
@define
19+
class MountBase:
2020
type: str
2121
target: str
2222
source: str | None = None
@@ -35,6 +35,7 @@ def __str__(self) -> str:
3535
return ",".join(self._parts())
3636

3737

38+
@define
3839
class BindMount(MountBase):
3940
type: str = "bind"
4041

@@ -63,6 +64,7 @@ def from_path(cls, path: Path) -> BindMount:
6364
return cls(source=str(absolute_path), target=str(absolute_path))
6465

6566

67+
@define
6668
class VolumeMount(MountBase):
6769
type: str = "volume"
6870

@@ -87,6 +89,7 @@ def _parts(self) -> list[str]:
8789
return parts
8890

8991

92+
@define
9093
class TmpfsMount(MountBase):
9194
type: str = "tmpfs"
9295

@@ -104,10 +107,7 @@ def _parts(self) -> list[str]:
104107
return parts
105108

106109

107-
MountPoint = Annotated[
108-
BindMount | VolumeMount | TmpfsMount,
109-
Field(discriminator="type"),
110-
]
110+
MountPoint = BindMount | VolumeMount | TmpfsMount
111111

112112
Mount = MountPoint | str | Path
113113

0 commit comments

Comments
 (0)