Skip to content

Replace ujson with orjson #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pylsp/__main__.py
Original file line number Diff line number Diff line change
@@ -2,16 +2,12 @@
# Copyright 2021- Python Language Server Contributors.

import argparse
import json
import logging
import logging.config
import sys
import time

try:
import ujson as json
except Exception:
import json

from ._version import __version__
from .python_lsp import (
PythonLSPServer,
4 changes: 2 additions & 2 deletions pylsp/plugins/pylint_lint.py
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@
from pylsp import hookimpl, lsp

try:
import ujson as json
except Exception:
import orjson as json
except ImportError:
import json

log = logging.getLogger(__name__)
4 changes: 2 additions & 2 deletions pylsp/python_lsp.py
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
from typing import Any, Dict, List

try:
import ujson as json
except Exception:
import orjson as json
except ImportError:
import json

from pylsp_jsonrpc.dispatchers import MethodDispatcher
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ dependencies = [
"importlib_metadata>=4.8.3;python_version<\"3.10\"",
"jedi>=0.17.2,<0.20.0",
"pluggy>=1.0.0",
"python-lsp-jsonrpc>=1.1.0,<2.0.0",
"ujson>=3.0.0",
"python-lsp-jsonrpc @ git+https://github.com/valrus/python-lsp-jsonrpc#egg=replace-ujson-with-orjson",
"orjson>=3.10.0",
]
dynamic = ["version"]