diff --git a/pyproject.toml b/pyproject.toml index 97cfad9..10215d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ ] 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)" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8, <4.0" classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent", @@ -27,8 +27,8 @@ classifiers = [ dependencies = [ "jedi-language-server==0.41.1", - "pydantic>=1.10.5, <2", - "requests==2.32.3" + "requests==2.32.3", + "typing-extensions>=4.2.0" ] [project.urls] diff --git a/requirements.txt b/requirements.txt index e07f909..4175153 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jedi-language-server==0.41.1 pytest==7.3.1 -pydantic>=1.10.5, <2 pytest-asyncio==0.21.1 requests==2.32.3 +typing-extensions>=4.2.0 diff --git a/src/multilspy/multilspy_logger.py b/src/multilspy/multilspy_logger.py index 86b83ee..df856bf 100644 --- a/src/multilspy/multilspy_logger.py +++ b/src/multilspy/multilspy_logger.py @@ -2,11 +2,12 @@ Multilspy logger module. """ import inspect +import json import logging from datetime import datetime -from pydantic import BaseModel +from typing_extensions import TypedDict -class LogLine(BaseModel): +class LogLine(TypedDict): """ Represents a line in the Multilspy log """ @@ -49,10 +50,10 @@ def log(self, debug_message: str, level: int, sanitized_error_message: str = "") caller_file=caller_file, caller_name=caller_name, caller_line=caller_line, - message=debug_message, + message=debug_message ) self.logger.log( level=level, - msg=debug_log_line.json(), + msg=json.dumps(debug_log_line), )