Skip to content

Commit d1b5d03

Browse files
Merge pull request #58 from AviAvni/update-pydantic
remove pydantic
2 parents 9dfe2c0 + 873637e commit d1b5d03

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
]
1212
description = "A language-agnostic LSP client in Python, with a library interface. Intended to be used to build applications around language servers. Currently multilspy supports language servers for Python, Rust, Java, Go, JavaScript, Ruby and C#. Originally appeared as part of Monitor-Guided Decoding (https://github.com/microsoft/monitors4codegen)"
1313
readme = "README.md"
14-
requires-python = ">=3.7"
14+
requires-python = ">=3.8, <4.0"
1515
classifiers = [
1616
"Programming Language :: Python :: 3",
1717
"Operating System :: OS Independent",
@@ -27,8 +27,8 @@ classifiers = [
2727

2828
dependencies = [
2929
"jedi-language-server==0.41.1",
30-
"pydantic>=1.10.5, <2",
31-
"requests==2.32.3"
30+
"requests==2.32.3",
31+
"typing-extensions>=4.2.0"
3232
]
3333

3434
[project.urls]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jedi-language-server==0.41.1
22
pytest==7.3.1
3-
pydantic>=1.10.5, <2
43
pytest-asyncio==0.21.1
54
requests==2.32.3
5+
typing-extensions>=4.2.0

src/multilspy/multilspy_logger.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
Multilspy logger module.
33
"""
44
import inspect
5+
import json
56
import logging
67
from datetime import datetime
7-
from pydantic import BaseModel
8+
from typing_extensions import TypedDict
89

9-
class LogLine(BaseModel):
10+
class LogLine(TypedDict):
1011
"""
1112
Represents a line in the Multilspy log
1213
"""
@@ -49,10 +50,10 @@ def log(self, debug_message: str, level: int, sanitized_error_message: str = "")
4950
caller_file=caller_file,
5051
caller_name=caller_name,
5152
caller_line=caller_line,
52-
message=debug_message,
53+
message=debug_message
5354
)
5455

5556
self.logger.log(
5657
level=level,
57-
msg=debug_log_line.json(),
58+
msg=json.dumps(debug_log_line),
5859
)

0 commit comments

Comments
 (0)