From f6a7c0297017331c18b9d0f28d08e7070cb8b17b Mon Sep 17 00:00:00 2001 From: Leo Ji Date: Thu, 26 Mar 2026 14:42:55 +0000 Subject: [PATCH] deps: replace deprecated ujson with orjson UJSON is deprecated and no longer recommended. Replace with orjson, which is the recommended alternative. Changes: - pyproject.toml: update dependency from ujson to orjson - pylsp/__main__.py: import orjson instead of ujson - pylsp/plugins/pylint_lint.py: import orjson instead of ujson - pylsp/python_lsp.py: import orjson instead of ujson Fixes #673 --- pylsp/__main__.py | 2 +- pylsp/plugins/pylint_lint.py | 2 +- pylsp/python_lsp.py | 2 +- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pylsp/__main__.py b/pylsp/__main__.py index 760f8829..624c15e3 100644 --- a/pylsp/__main__.py +++ b/pylsp/__main__.py @@ -8,7 +8,7 @@ import time try: - import ujson as json + import orjson as json except Exception: import json diff --git a/pylsp/plugins/pylint_lint.py b/pylsp/plugins/pylint_lint.py index f3415c8a..efc84ebc 100644 --- a/pylsp/plugins/pylint_lint.py +++ b/pylsp/plugins/pylint_lint.py @@ -15,7 +15,7 @@ from pylsp import hookimpl, lsp try: - import ujson as json + import orjson as json except Exception: import json diff --git a/pylsp/python_lsp.py b/pylsp/python_lsp.py index bdc072d4..0d2cd491 100644 --- a/pylsp/python_lsp.py +++ b/pylsp/python_lsp.py @@ -11,7 +11,7 @@ from typing import Any try: - import ujson as json + import orjson as json except Exception: import json diff --git a/pyproject.toml b/pyproject.toml index 8fe9c574..e3c2bcc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "jedi>=0.17.2,<0.20.0", "pluggy>=1.0.0", "python-lsp-jsonrpc>=1.1.0,<2.0.0", - "ujson>=3.0.0", + "orjson>=3.0.0", "black" ] dynamic = ["version"]