Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-python-lsp-jsonrpc for
openSUSE:Factory checked in at 2023-11-01 22:10:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-lsp-jsonrpc (Old)
and /work/SRC/openSUSE:Factory/.python-python-lsp-jsonrpc.new.17445 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-lsp-jsonrpc"
Wed Nov 1 22:10:20 2023 rev:2 rq:1121664 version:1.1.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-lsp-jsonrpc/python-python-lsp-jsonrpc.changes
2021-07-16 22:13:23.278556391 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-lsp-jsonrpc.new.17445/python-python-lsp-jsonrpc.changes
2023-11-01 22:11:03.290055361 +0100
@@ -1,0 +2,19 @@
+Wed Nov 1 16:48:02 UTC 2023 - Ben Greiner <[email protected]>
+
+- Fix requirements
+- Don't check coverage
+
+-------------------------------------------------------------------
+Wed Nov 1 06:10:09 UTC 2023 - Steve Kowalik <[email protected]>
+
+- Update to 1.1.2:
+ * Fix tests so they're compatible with both ujson and pure json library
+ * Remove redundant wheel dep from pyproject.toml
+ * Add license trove classifier
+ * Drop support for Python 3.7 and 3.6
+ * Allow method handlers to return json rpc errors
+ * Migrate metadata from `setup.cfg` to PEP 621-compliant `pyproject.toml`
+ * Use f-strings wherever possible
+- Switch to pyproject macros.
+
+-------------------------------------------------------------------
Old:
----
python-lsp-jsonrpc-1.0.0.tar.gz
New:
----
python-lsp-jsonrpc-1.1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-lsp-jsonrpc.spec ++++++
--- /var/tmp/diff_new_pack.b0a5qv/_old 2023-11-01 22:11:03.942079515 +0100
+++ /var/tmp/diff_new_pack.b0a5qv/_new 2023-11-01 22:11:03.942079515 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-python-lsp-jsonrpc
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,17 +16,19 @@
#
-%{?!python_module:%define python_module() python3-%{**}}
-%define skip_python2 1
Name: python-python-lsp-jsonrpc
-Version: 1.0.0
+Version: 1.1.2
Release: 0
Summary: JSON RPC 2.0 server library
License: MIT
URL: https://github.com/python-lsp/python-lsp-jsonrpc
Source:
https://files.pythonhosted.org/packages/source/p/python-lsp-jsonrpc/python-lsp-jsonrpc-%{version}.tar.gz
+BuildRequires: %{python_module base >= 3.8}
+BuildRequires: %{python_module pip}
+BuildRequires: %{python_module setuptools >= 61.2}
+BuildRequires: %{python_module setuptools_scm >= 3.4.3}
+BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
-BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module ujson >= 3.0.0}
BuildRequires: %{python_module pytest}
@@ -40,25 +42,23 @@
A Python 3.6+ server implementation of the JSON RPC 2.0 protocol.
This library has been pulled out of the Python Language Server project.
-
%prep
%setup -q -n python-lsp-jsonrpc-%{version}
+sed -i /addopts/d pyproject.toml
%build
-%python_build
+%pyproject_wheel
%install
-%python_install
+%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-# Remove pytest addopts
-rm setup.cfg
%pytest
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/pylsp_jsonrpc
-%{python_sitelib}/python_lsp_jsonrpc-%{version}*-info
+%{python_sitelib}/python_lsp_jsonrpc-%{version}.dist-info
++++++ python-lsp-jsonrpc-1.0.0.tar.gz -> python-lsp-jsonrpc-1.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/.coveragerc
new/python-lsp-jsonrpc-1.1.2/.coveragerc
--- old/python-lsp-jsonrpc-1.0.0/.coveragerc 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/.coveragerc 2022-01-10 22:08:23.000000000
+0100
@@ -0,0 +1,2 @@
+[run]
+omit = pylsp_jsonrpc/_version.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/.gitattributes
new/python-lsp-jsonrpc-1.1.2/.gitattributes
--- old/python-lsp-jsonrpc-1.0.0/.gitattributes 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/.gitattributes 2021-02-21 18:24:16.000000000
+0100
@@ -0,0 +1 @@
+jsonrpc/_version.py export-subst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/.github/workflows/static.yml
new/python-lsp-jsonrpc-1.1.2/.github/workflows/static.yml
--- old/python-lsp-jsonrpc-1.0.0/.github/workflows/static.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/.github/workflows/static.yml 2022-05-10
05:45:17.000000000 +0200
@@ -0,0 +1,40 @@
+name: Static code analysis
+
+on:
+ push:
+ branches:
+ - develop
+
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ build:
+ name: Static code analysis
+ runs-on: ubuntu-latest
+ env:
+ CI: 'true'
+ OS: 'linux'
+ timeout-minutes: 2
+ steps:
+ - uses: actions/cache@v1
+ with:
+ path: ~/.cache/pip
+ key: static-pip-${{ hashFiles('setup.py') }}
+ restore-keys: static-pip-
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ # TODO: check with Python 3, but need to fix the
+ # errors first
+ python-version: '3.8'
+ architecture: 'x64'
+ - run: python -m pip install --upgrade pip setuptools
+ - run: pip install -e .[test]
+ - name: Pylint checks
+ run: pylint pylsp_jsonrpc test
+ - name: Code style checks
+ run: pycodestyle pylsp_jsonrpc test
+ - name: Pyflakes checks
+ run: pyflakes pylsp_jsonrpc test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-linux.yml
new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-linux.yml
--- old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-linux.yml
1970-01-01 01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-linux.yml
2023-09-08 00:31:24.000000000 +0200
@@ -0,0 +1,42 @@
+name: Linux tests
+
+on:
+ push:
+ branches:
+ - develop
+
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ build:
+ name: Linux Py${{ matrix.PYTHON_VERSION }}
+ runs-on: ubuntu-latest
+ env:
+ CI: 'true'
+ OS: 'linux'
+ PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
+ strategy:
+ fail-fast: false
+ matrix:
+ PYTHON_VERSION: ['3.10', '3.9', '3.8']
+ timeout-minutes: 10
+ steps:
+ - uses: actions/cache@v1
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{
hashFiles('setup.py') }}
+ restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.PYTHON_VERSION }}
+ architecture: 'x64'
+ - run: python -m pip install --upgrade pip setuptools
+ - run: pip install -e .[all,test]
+ - run: pytest -v test/
+ # Enable this if SSH debugging is required
+ # - name: Setup tmate session
+ # uses: mxschmitt/action-tmate@v3
+ # if: ${{ failure() }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-mac.yml
new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-mac.yml
--- old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-mac.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-mac.yml 2023-09-08
00:31:24.000000000 +0200
@@ -0,0 +1,42 @@
+name: Mac tests
+
+on:
+ push:
+ branches:
+ - develop
+
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ build:
+ name: Mac Py${{ matrix.PYTHON_VERSION }}
+ runs-on: macos-latest
+ env:
+ CI: 'true'
+ OS: 'macos'
+ PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
+ strategy:
+ fail-fast: false
+ matrix:
+ PYTHON_VERSION: ['3.10', '3.9', '3.8']
+ timeout-minutes: 10
+ steps:
+ - uses: actions/cache@v1
+ with:
+ path: ~/Library/Caches/pip
+ key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{
hashFiles('setup.py') }}
+ restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.PYTHON_VERSION }}
+ architecture: 'x64'
+ - run: python -m pip install --upgrade pip setuptools
+ - run: pip install -e .[all,test]
+ - run: pytest -v test/
+ # Enable this if SSH debugging is required
+ # - name: Setup tmate session
+ # uses: mxschmitt/action-tmate@v3
+ # if: ${{ failure() }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-win.yml
new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-win.yml
--- old/python-lsp-jsonrpc-1.0.0/.github/workflows/test-win.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/.github/workflows/test-win.yml 2023-09-08
00:31:24.000000000 +0200
@@ -0,0 +1,38 @@
+name: Windows tests
+
+on:
+ push:
+ branches:
+ - develop
+
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ build:
+ name: Win Py${{ matrix.PYTHON_VERSION }}
+ runs-on: windows-latest
+ env:
+ CI: 'true'
+ OS: 'win'
+ PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
+ strategy:
+ fail-fast: false
+ matrix:
+ PYTHON_VERSION: ['3.10', '3.9', '3.8']
+ timeout-minutes: 10
+ steps:
+ - uses: actions/cache@v1
+ with:
+ path: ~\AppData\Local\pip\Cache
+ key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{
hashFiles('setup.py') }}
+ restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.PYTHON_VERSION }}
+ architecture: 'x64'
+ - run: python -m pip install --upgrade pip setuptools
+ - run: pip install -e .[all,test]
+ - run: pytest -v test/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/.gitignore
new/python-lsp-jsonrpc-1.1.2/.gitignore
--- old/python-lsp-jsonrpc-1.0.0/.gitignore 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/.gitignore 2022-05-15 18:12:50.000000000
+0200
@@ -0,0 +1,114 @@
+# autogenerated version file
+/pylsp_jsonrpc/_version.py
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# IntelliJ
+*.iml
+*.ipr
+*.iws
+.idea/
+out/
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+env3/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+pytest.xml
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# IPython Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery beat schedule file
+celerybeat-schedule
+
+# dotenv
+.env
+
+# virtualenv
+venv/
+ENV/
+
+# Spyder project settings
+.spyderproject
+
+# Rope project settings
+.ropeproject
+
+# JavaScript
+**/*.vscode/
+
+# vim
+*.sw[mnopqrs]
+
+# Idea
+.idea/
+
+# Merge orig files
+*.orig
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/CHANGELOG.md
new/python-lsp-jsonrpc-1.1.2/CHANGELOG.md
--- old/python-lsp-jsonrpc-1.0.0/CHANGELOG.md 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/CHANGELOG.md 2023-09-23 19:46:03.000000000
+0200
@@ -0,0 +1,71 @@
+# History of changes
+
+## Version 1.1.2 (2023/09/23)
+
+### Pull Requests Merged
+
+* [PR 26](https://github.com/python-lsp/python-lsp-jsonrpc/pull/26) - Fix
tests so they're compatible with both ujson and pure json library, by
[@ajohnston9](https://github.com/ajohnston9)
+
+In this release 1 pull request was closed.
+
+----
+
+## Version 1.1.1 (2023/09/09)
+
+### Issues Closed
+
+* [Issue 18](https://github.com/python-lsp/python-lsp-jsonrpc/issues/18) - No
license included in package metadata ([PR
19](https://github.com/python-lsp/python-lsp-jsonrpc/pull/19) by
[@thejcannon](https://github.com/thejcannon))
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+* [PR 23](https://github.com/python-lsp/python-lsp-jsonrpc/pull/23) - Remove
redundant wheel dep from pyproject.toml, by [@mgorny](https://github.com/mgorny)
+* [PR 19](https://github.com/python-lsp/python-lsp-jsonrpc/pull/19) - Add
license trove classifier, by [@thejcannon](https://github.com/thejcannon)
([18](https://github.com/python-lsp/python-lsp-jsonrpc/issues/18))
+
+In this release 2 pull requests were closed.
+
+----
+
+## Version 1.1.0 (2023/09/07)
+
+## New features
+
+* Allow method handlers to return json rpc errors
+* Drop support for Python 3.7 and 3.6
+
+### Issues Closed
+
+* [Issue 11](https://github.com/python-lsp/python-lsp-jsonrpc/issues/11) -
Drop support for Python 3.6 ([PR
16](https://github.com/python-lsp/python-lsp-jsonrpc/pull/16) by
[@ccordoba12](https://github.com/ccordoba12))
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+* [PR 21](https://github.com/python-lsp/python-lsp-jsonrpc/pull/21) - Drop
support for Python 3.7, by [@ccordoba12](https://github.com/ccordoba12)
+* [PR 20](https://github.com/python-lsp/python-lsp-jsonrpc/pull/20) - Allow
method handlers to return json rpc errors, by
[@smacke](https://github.com/smacke)
+* [PR 16](https://github.com/python-lsp/python-lsp-jsonrpc/pull/16) - Make
necessary changes to drop support for Python 3.6, by
[@ccordoba12](https://github.com/ccordoba12)
([11](https://github.com/python-lsp/python-lsp-jsonrpc/issues/11))
+* [PR 15](https://github.com/python-lsp/python-lsp-jsonrpc/pull/15) - Drop
Python 3.6 on CIs and start testing with Python 3.10, by
[@ccordoba12](https://github.com/ccordoba12)
+* [PR 14](https://github.com/python-lsp/python-lsp-jsonrpc/pull/14) - Migrate
metadata from `setup.cfg` to PEP 621-compliant `pyproject.toml`, by
[@KOLANICH](https://github.com/KOLANICH)
+* [PR 10](https://github.com/python-lsp/python-lsp-jsonrpc/pull/10) - Use
f-strings wherever possible, by [@ccordoba12](https://github.com/ccordoba12)
+* [PR 9](https://github.com/python-lsp/python-lsp-jsonrpc/pull/9) - Add
license info to setup.py so it will show up in wheel installs., by
[@itsbenweeks](https://github.com/itsbenweeks)
+* [PR 8](https://github.com/python-lsp/python-lsp-jsonrpc/pull/8) - Move the
package metadata from setup.py to setup.cfg, by
[@KOLANICH](https://github.com/KOLANICH)
+* [PR 4](https://github.com/python-lsp/python-lsp-jsonrpc/pull/4) - PR: Fix
typos in readme, by [@yaegassy](https://github.com/yaegassy)
+
+In this release 9 pull requests were closed.
+
+----
+
+## Version 1.0.0 (2021/04/14)
+
+### Issues Closed
+
+* [Issue 3](https://github.com/python-lsp/python-lsp-jsonrpc/issues/3) -
Release v1.0.0
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+* [PR 2](https://github.com/python-lsp/python-lsp-jsonrpc/pull/2) - PR: Update
package name, remove Python 2 compatibility and update CIs, by
[@andfoy](https://github.com/andfoy)
+
+In this release 1 pull request was closed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/PKG-INFO
new/python-lsp-jsonrpc-1.1.2/PKG-INFO
--- old/python-lsp-jsonrpc-1.0.0/PKG-INFO 2021-04-14 23:13:43.751572400
+0200
+++ new/python-lsp-jsonrpc-1.1.2/PKG-INFO 2023-09-23 19:47:51.097817200
+0200
@@ -1,28 +1,37 @@
Metadata-Version: 2.1
Name: python-lsp-jsonrpc
-Version: 1.0.0
+Version: 1.1.2
Summary: JSON RPC 2.0 server library
-Home-page: https://github.com/python-lsp/python-lsp-jsonrpc
Author: Python Language Server Contributors
-License: UNKNOWN
-Description: # Python JSON RPC Server
-
- A Python 3.6+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
-
- ## Installation
-
- pip install -U python-jsonrpc-server
-
- ## Examples
-
- The examples directory contains two examples of running language
servers over websockets. `examples/langserver.py` shows how to run a language
server in-memory. `examples/langserver_ext.py` shows how to run a subprocess
language server, in this case the Python LSP Server.
-
- Start by installing `tornado` and `python-language-server`
-
- pip install python-lsp-server[all] tornado
-
- Then running `python examples/langserver.py` or `python
examples/langserver_ext.py` will host a websocket on
``ws://localhost:3000/python``.
-
-Platform: UNKNOWN
+License: MIT
+Project-URL: Homepage, https://github.com/python-lsp/python-lsp-jsonrpc
+Classifier: License :: OSI Approved :: MIT License
+Requires-Python: >=3.8
Description-Content-Type: text/markdown
+License-File: LICENSE
+Requires-Dist: ujson>=3.0.0
Provides-Extra: test
+Requires-Dist: pylint; extra == "test"
+Requires-Dist: pycodestyle; extra == "test"
+Requires-Dist: pyflakes; extra == "test"
+Requires-Dist: pytest; extra == "test"
+Requires-Dist: pytest-cov; extra == "test"
+Requires-Dist: coverage; extra == "test"
+
+# Python JSON RPC Server
+
+A Python 3.8+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
+
+## Installation
+
+ pip install -U python-lsp-jsonrpc
+
+## Examples
+
+The examples directory contains two examples of running language servers over
websockets. `examples/langserver.py` shows how to run a language server
in-memory. `examples/langserver_ext.py` shows how to run a subprocess language
server, in this case the Python LSP Server.
+
+Start by installing `tornado` and `python-lsp-server`
+
+ pip install python-lsp-server[all] tornado
+
+Then running `python examples/langserver.py` or `python
examples/langserver_ext.py` will host a websocket on
``ws://localhost:3000/python``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/README.md
new/python-lsp-jsonrpc-1.1.2/README.md
--- old/python-lsp-jsonrpc-1.0.0/README.md 2021-04-14 23:05:37.000000000
+0200
+++ new/python-lsp-jsonrpc-1.1.2/README.md 2023-09-08 00:31:24.000000000
+0200
@@ -1,16 +1,16 @@
# Python JSON RPC Server
-A Python 3.6+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
+A Python 3.8+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
## Installation
- pip install -U python-jsonrpc-server
+ pip install -U python-lsp-jsonrpc
## Examples
The examples directory contains two examples of running language servers over
websockets. `examples/langserver.py` shows how to run a language server
in-memory. `examples/langserver_ext.py` shows how to run a subprocess language
server, in this case the Python LSP Server.
-Start by installing `tornado` and `python-language-server`
+Start by installing `tornado` and `python-lsp-server`
pip install python-lsp-server[all] tornado
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/RELEASE.md
new/python-lsp-jsonrpc-1.1.2/RELEASE.md
--- old/python-lsp-jsonrpc-1.0.0/RELEASE.md 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/RELEASE.md 2023-09-08 00:42:38.000000000
+0200
@@ -0,0 +1,22 @@
+## Before the release:
+
+1. Create pull request to update CHANGELOG.md with
+ * `loghub python-lsp/python-lsp-jsonrpc -m vX.X.X`
+ * git add -A && git commit -m "Update changelog for X.X.X"
+
+ This is necessary to run our tests before the release, so we can be sure
+ everything is in order.
+
+## To release a new version of python-lsp-jsonrpc:
+
+1. git fetch upstream && git checkout upstream/master
+2. Close milestone on GitHub
+3. git clean -xfdi
+4. git tag -a vX.X.X -m "Release vX.X.X"
+5. python -m pip install --upgrade pip
+6. pip install --upgrade --upgrade-strategy eager build setuptools twine wheel
+7. python -bb -X dev -W error -m build
+8. twine check --strict dist/*
+9. twine upload dist/*
+10. git push upstream --tags
+11. Create release on Github
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/examples/langserver.py
new/python-lsp-jsonrpc-1.1.2/examples/langserver.py
--- old/python-lsp-jsonrpc-1.0.0/examples/langserver.py 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/examples/langserver.py 2022-01-10
22:08:23.000000000 +0100
@@ -0,0 +1,75 @@
+import logging
+
+from tornado import web, ioloop, websocket
+
+from pylsp_jsonrpc import dispatchers, endpoint
+
+try:
+ import ujson as json
+except Exception: # pylint: disable=broad-except
+ import json
+
+log = logging.getLogger(__name__)
+
+
+class LanguageServer(dispatchers.MethodDispatcher):
+ """Implement a JSON RPC method dispatcher for the language server
protocol."""
+
+ def __init__(self):
+ # Endpoint is lazily set after construction
+ self.endpoint = None
+
+ def m_initialize(self, rootUri=None, **kwargs):
+ log.info("Got initialize params: %s", kwargs)
+ return {"capabilities": {
+ "textDocumentSync": {
+ "openClose": True,
+ }
+ }}
+
+ def m_text_document__did_open(self, textDocument=None, **_kwargs):
+ log.info("Opened text document %s", textDocument)
+ self.endpoint.notify('textDocument/publishDiagnostics', {
+ 'uri': textDocument['uri'],
+ 'diagnostics': [{
+ 'range': {
+ 'start': {'line': 0, 'character': 0},
+ 'end': {'line': 1, 'character': 0},
+ },
+ 'message': 'Some very bad Python code',
+ 'severity': 1 # DiagnosticSeverity.Error
+ }]
+ })
+
+
+class LanguageServerWebSocketHandler(websocket.WebSocketHandler):
+ """Setup tornado websocket handler to host language server."""
+
+ def __init__(self, *args, **kwargs):
+ # Create an instance of the language server used to dispatch JSON RPC
methods
+ langserver = LanguageServer()
+
+ # Setup an endpoint that dispatches to the ls, and writes
server->client messages
+ # back to the client websocket
+ self.endpoint = endpoint.Endpoint(langserver, lambda msg:
self.write_message(json.dumps(msg)))
+
+ # Give the language server a handle to the endpoint so it can send
JSON RPC
+ # notifications and requests.
+ langserver.endpoint = self.endpoint
+
+ super(LanguageServerWebSocketHandler, self).__init__(*args, **kwargs)
+
+ def on_message(self, message):
+ """Forward client->server messages to the endpoint."""
+ self.endpoint.consume(json.loads(message))
+
+ def check_origin(self, origin):
+ return True
+
+
+if __name__ == "__main__":
+ app = web.Application([
+ (r"/python", LanguageServerWebSocketHandler),
+ ])
+ app.listen(3000, address='127.0.0.1')
+ ioloop.IOLoop.current().start()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/examples/langserver_ext.py
new/python-lsp-jsonrpc-1.1.2/examples/langserver_ext.py
--- old/python-lsp-jsonrpc-1.0.0/examples/langserver_ext.py 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/examples/langserver_ext.py 2022-01-10
22:08:23.000000000 +0100
@@ -0,0 +1,60 @@
+import logging
+import subprocess
+import threading
+
+from tornado import ioloop, process, web, websocket
+
+from pylsp_jsonrpc import streams
+
+try:
+ import ujson as json
+except Exception: # pylint: disable=broad-except
+ import json
+
+log = logging.getLogger(__name__)
+
+
+class LanguageServerWebSocketHandler(websocket.WebSocketHandler):
+ """Setup tornado websocket handler to host an external language server."""
+
+ writer = None
+
+ def open(self, *args, **kwargs):
+ log.info("Spawning pylsp subprocess")
+
+ # Create an instance of the language server
+ proc = process.Subprocess(
+ ['pylsp', '-v'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE
+ )
+
+ # Create a writer that formats json messages with the correct LSP
headers
+ self.writer = streams.JsonRpcStreamWriter(proc.stdin)
+
+ # Create a reader for consuming stdout of the language server. We need
to
+ # consume this in another thread
+ def consume():
+ # Start a tornado IOLoop for reading/writing to the process in
this thread
+ ioloop.IOLoop()
+ reader = streams.JsonRpcStreamReader(proc.stdout)
+ reader.listen(lambda msg: self.write_message(json.dumps(msg)))
+
+ thread = threading.Thread(target=consume)
+ thread.daemon = True
+ thread.start()
+
+ def on_message(self, message):
+ """Forward client->server messages to the endpoint."""
+ self.writer.write(json.loads(message))
+
+ def check_origin(self, origin):
+ return True
+
+
+if __name__ == "__main__":
+ app = web.Application([
+ (r"/python", LanguageServerWebSocketHandler),
+ ])
+ app.listen(3000, address='127.0.0.1')
+ ioloop.IOLoop.current().start()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/__init__.py
new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/__init__.py
--- old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/__init__.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/__init__.py 2022-05-15
18:12:50.000000000 +0200
@@ -1,6 +1,23 @@
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
+from . import _version
from ._version import __version__
-__all__ = [__version__]
+
+def convert_version_info(version: str) -> (int, ..., str):
+ version_info = version.split(".")
+ for i in range(len(version_info)): #
pylint:disable=consider-using-enumerate
+ try:
+ version_info[i] = int(version_info[i])
+ except ValueError:
+ version_info[i] = version_info[i].split("+")[0]
+ version_info = version_info[: i + 1]
+ break
+
+ return tuple(version_info)
+
+
+_version.VERSION_INFO = convert_version_info(__version__)
+
+__all__ = ("__version__",)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/_version.py
new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/_version.py
--- old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/_version.py 2021-04-14
23:13:05.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/_version.py 2023-09-23
19:47:50.000000000 +0200
@@ -1,5 +1 @@
-# Copyright 2017-2020 Palantir Technologies, Inc.
-# Copyright 2021- Python Language Server Contributors.
-
-VERSION_INFO = (1, 0, 0)
-__version__ = '.'.join(map(str, VERSION_INFO))
+__version__ = "1.1.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/dispatchers.py
new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/dispatchers.py
--- old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/dispatchers.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/dispatchers.py 2022-01-10
22:19:15.000000000 +0100
@@ -16,7 +16,7 @@
"""
def __getitem__(self, item):
- method_name = 'm_{}'.format(_method_to_string(item))
+ method_name = f'm_{_method_to_string(item)}'
if hasattr(self, method_name):
method = getattr(self, method_name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/endpoint.py
new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/endpoint.py
--- old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/endpoint.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/endpoint.py 2023-09-08
00:15:39.000000000 +0200
@@ -4,6 +4,7 @@
import logging
import uuid
import sys
+from typing import Any, Dict, Mapping
from concurrent import futures
from .exceptions import (JsonRpcException, JsonRpcRequestCancelled,
@@ -175,6 +176,17 @@
if request_future.cancel():
log.debug("Cancelled request with id %s", msg_id)
+ @staticmethod
+ def _make_response_payload(header: Dict[str, Any], result: Any) ->
Mapping[str, Any]:
+ # return type of 'Mapping' because it should not be mutated
+ # further from here
+ response = dict(header)
+ if isinstance(result, dict) and ('result' in result or 'error' in
result):
+ response.update(result)
+ else:
+ response['result'] = result
+ return response
+
def _handle_request(self, msg_id, method, params):
"""Handle a request from the client."""
try:
@@ -195,11 +207,14 @@
handler_result.add_done_callback(self._request_callback(msg_id))
else:
log.debug("Got result from synchronous request handler: %s",
handler_result)
- self._consumer({
- 'jsonrpc': JSONRPC_VERSION,
- 'id': msg_id,
- 'result': handler_result
- })
+ response = self._make_response_payload(
+ {
+ 'jsonrpc': JSONRPC_VERSION,
+ 'id': msg_id,
+ },
+ handler_result,
+ )
+ self._consumer(response)
def _request_callback(self, request_id):
"""Construct a request callback for the given request ID."""
@@ -216,7 +231,8 @@
}
try:
- message['result'] = future.result()
+ result = future.result()
+ message = self._make_response_payload(message, result)
except JsonRpcException as e:
log.exception("Failed to handle request %s", request_id)
message['error'] = e.to_dict()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/streams.py
new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/streams.py
--- old/python-lsp-jsonrpc-1.0.0/pylsp_jsonrpc/streams.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/pylsp_jsonrpc/streams.py 2022-01-10
22:19:15.000000000 +0100
@@ -74,7 +74,7 @@
try:
return int(value)
except ValueError as e:
- raise ValueError("Invalid Content-Length header:
{}".format(value)) from e
+ raise ValueError(f"Invalid Content-Length header: {value}")
from e
return None
@@ -100,9 +100,9 @@
content_length = len(body) if isinstance(body, bytes) else
len(body.encode('utf-8'))
response = (
- "Content-Length: {}\r\n"
- "Content-Type: application/vscode-jsonrpc;
charset=utf8\r\n\r\n"
- "{}".format(content_length, body)
+ f"Content-Length: {content_length}\r\n"
+ f"Content-Type: application/vscode-jsonrpc;
charset=utf8\r\n\r\n"
+ f"{body}"
)
self._wfile.write(response.encode('utf-8'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/pyproject.toml
new/python-lsp-jsonrpc-1.1.2/pyproject.toml
--- old/python-lsp-jsonrpc-1.0.0/pyproject.toml 1970-01-01 01:00:00.000000000
+0100
+++ new/python-lsp-jsonrpc-1.1.2/pyproject.toml 2023-09-09 23:56:19.000000000
+0200
@@ -0,0 +1,51 @@
+# Copyright 2017-2020 Palantir Technologies, Inc.
+# Copyright 2021- Python Language Server Contributors.
+
+[build-system]
+requires = ["setuptools>=61.2.0", "setuptools_scm[toml]>=3.4.3"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "python-lsp-jsonrpc"
+authors = [{name = "Python Language Server Contributors"}]
+description = "JSON RPC 2.0 server library"
+license = {text = "MIT"}
+requires-python = ">=3.8"
+dependencies = ["ujson>=3.0.0"]
+dynamic = ["version"]
+classifiers = [
+ "License :: OSI Approved :: MIT License",
+]
+
+[project.readme]
+file = "README.md"
+content-type = "text/markdown"
+
+[project.urls]
+Homepage = "https://github.com/python-lsp/python-lsp-jsonrpc"
+
+[project.optional-dependencies]
+test = [
+ "pylint",
+ "pycodestyle",
+ "pyflakes",
+ "pytest",
+ "pytest-cov",
+ "coverage",
+]
+
+[tool.setuptools]
+license-files = ["LICENSE"]
+include-package-data = false
+
+[tool.setuptools.packages.find]
+exclude = ["contrib", "docs", "test", "test.*"]
+namespaces = false
+
+[tool.setuptools_scm]
+write_to = "pylsp_jsonrpc/_version.py"
+write_to_template = "__version__ = \"{version}\"\n" # VERSION_INFO is
populated in __main__
+
+[tool.pytest.ini_options]
+testpaths = ["test"]
+addopts = "--cov-report html --cov-report term --junitxml=pytest.xml --cov
pylsp_jsonrpc --cov test"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/python_lsp_jsonrpc.egg-info/PKG-INFO
new/python-lsp-jsonrpc-1.1.2/python_lsp_jsonrpc.egg-info/PKG-INFO
--- old/python-lsp-jsonrpc-1.0.0/python_lsp_jsonrpc.egg-info/PKG-INFO
2021-04-14 23:13:43.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/python_lsp_jsonrpc.egg-info/PKG-INFO
2023-09-23 19:47:51.000000000 +0200
@@ -1,28 +1,37 @@
Metadata-Version: 2.1
Name: python-lsp-jsonrpc
-Version: 1.0.0
+Version: 1.1.2
Summary: JSON RPC 2.0 server library
-Home-page: https://github.com/python-lsp/python-lsp-jsonrpc
Author: Python Language Server Contributors
-License: UNKNOWN
-Description: # Python JSON RPC Server
-
- A Python 3.6+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
-
- ## Installation
-
- pip install -U python-jsonrpc-server
-
- ## Examples
-
- The examples directory contains two examples of running language
servers over websockets. `examples/langserver.py` shows how to run a language
server in-memory. `examples/langserver_ext.py` shows how to run a subprocess
language server, in this case the Python LSP Server.
-
- Start by installing `tornado` and `python-language-server`
-
- pip install python-lsp-server[all] tornado
-
- Then running `python examples/langserver.py` or `python
examples/langserver_ext.py` will host a websocket on
``ws://localhost:3000/python``.
-
-Platform: UNKNOWN
+License: MIT
+Project-URL: Homepage, https://github.com/python-lsp/python-lsp-jsonrpc
+Classifier: License :: OSI Approved :: MIT License
+Requires-Python: >=3.8
Description-Content-Type: text/markdown
+License-File: LICENSE
+Requires-Dist: ujson>=3.0.0
Provides-Extra: test
+Requires-Dist: pylint; extra == "test"
+Requires-Dist: pycodestyle; extra == "test"
+Requires-Dist: pyflakes; extra == "test"
+Requires-Dist: pytest; extra == "test"
+Requires-Dist: pytest-cov; extra == "test"
+Requires-Dist: coverage; extra == "test"
+
+# Python JSON RPC Server
+
+A Python 3.8+ server implementation of the [JSON RPC
2.0](http://www.jsonrpc.org/specification) protocol. This library has been
pulled out of the [Python LSP
Server](https://github.com/python-lsp/python-lsp-server) project.
+
+## Installation
+
+ pip install -U python-lsp-jsonrpc
+
+## Examples
+
+The examples directory contains two examples of running language servers over
websockets. `examples/langserver.py` shows how to run a language server
in-memory. `examples/langserver_ext.py` shows how to run a subprocess language
server, in this case the Python LSP Server.
+
+Start by installing `tornado` and `python-lsp-server`
+
+ pip install python-lsp-server[all] tornado
+
+Then running `python examples/langserver.py` or `python
examples/langserver_ext.py` will host a websocket on
``ws://localhost:3000/python``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-lsp-jsonrpc-1.0.0/python_lsp_jsonrpc.egg-info/SOURCES.txt
new/python-lsp-jsonrpc-1.1.2/python_lsp_jsonrpc.egg-info/SOURCES.txt
--- old/python-lsp-jsonrpc-1.0.0/python_lsp_jsonrpc.egg-info/SOURCES.txt
2021-04-14 23:13:43.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/python_lsp_jsonrpc.egg-info/SOURCES.txt
2023-09-23 19:47:51.000000000 +0200
@@ -1,9 +1,20 @@
+.coveragerc
+.gitattributes
+.gitignore
.pylintrc
+CHANGELOG.md
LICENSE
MANIFEST.in
README.md
+RELEASE.md
+pyproject.toml
setup.cfg
-setup.py
+.github/workflows/static.yml
+.github/workflows/test-linux.yml
+.github/workflows/test-mac.yml
+.github/workflows/test-win.yml
+examples/langserver.py
+examples/langserver_ext.py
pylsp_jsonrpc/__init__.py
pylsp_jsonrpc/_version.py
pylsp_jsonrpc/dispatchers.py
@@ -15,6 +26,7 @@
python_lsp_jsonrpc.egg-info/dependency_links.txt
python_lsp_jsonrpc.egg-info/requires.txt
python_lsp_jsonrpc.egg-info/top_level.txt
+scripts/circle/pypi.sh
test/__init__.py
test/test_endpoint.py
test/test_streams.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/scripts/circle/pypi.sh
new/python-lsp-jsonrpc-1.1.2/scripts/circle/pypi.sh
--- old/python-lsp-jsonrpc-1.0.0/scripts/circle/pypi.sh 1970-01-01
01:00:00.000000000 +0100
+++ new/python-lsp-jsonrpc-1.1.2/scripts/circle/pypi.sh 2021-02-21
18:24:16.000000000 +0100
@@ -0,0 +1,17 @@
+#!/bin/bash -e
+
+if [ -z "$CI" ]; then
+ echo "Will only continue on CI"
+ exit
+fi
+
+# build package and upload to private pypi index
+rm -f ~/.pypirc
+echo "[distutils]" >> ~/.pypirc
+echo "index-servers = pypi-private" >> ~/.pypirc
+echo "[pypi-private]" >> ~/.pypirc
+echo "repository=https://$PYPI_HOST" >> ~/.pypirc
+echo "username=$PYPI_USERNAME" >> ~/.pypirc
+echo "password=$PYPI_PASSWORD" >> ~/.pypirc
+
+python setup.py sdist bdist_wheel upload -r pypi-private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/setup.cfg
new/python-lsp-jsonrpc-1.1.2/setup.cfg
--- old/python-lsp-jsonrpc-1.0.0/setup.cfg 2021-04-14 23:13:43.751572400
+0200
+++ new/python-lsp-jsonrpc-1.1.2/setup.cfg 2023-09-23 19:47:51.097817200
+0200
@@ -3,12 +3,6 @@
max-line-length = 120
exclude = test/plugins/.ropeproject,test/.ropeproject
-[tool:pytest]
-testpaths = test
-addopts =
- --cov-report html --cov-report term --junitxml=pytest.xml
- --cov pylsp_jsonrpc --cov test
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/setup.py
new/python-lsp-jsonrpc-1.1.2/setup.py
--- old/python-lsp-jsonrpc-1.0.0/setup.py 2021-04-14 23:05:37.000000000
+0200
+++ new/python-lsp-jsonrpc-1.1.2/setup.py 1970-01-01 01:00:00.000000000
+0100
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2017-2020 Palantir Technologies, Inc.
-# Copyright 2021- Python Language Server Contributors.
-
-import ast
-import os
-from setuptools import find_packages, setup
-
-HERE = os.path.abspath(os.path.dirname(__file__))
-
-
-def get_version(module='pylsp_jsonrpc'):
- """Get version."""
- with open(os.path.join(HERE, module, '_version.py'), 'r') as f:
- data = f.read()
- lines = data.split('\n')
- for line in lines:
- if line.startswith('VERSION_INFO'):
- version_tuple = ast.literal_eval(line.split('=')[-1].strip())
- version = '.'.join(map(str, version_tuple))
- break
- return version
-
-
-README = open('README.md', 'r').read()
-
-
-setup(
- name='python-lsp-jsonrpc',
- version=get_version(),
- description='JSON RPC 2.0 server library',
- long_description=README,
- long_description_content_type='text/markdown',
- url='https://github.com/python-lsp/python-lsp-jsonrpc',
- author='Python Language Server Contributors',
- packages=find_packages(exclude=['contrib', 'docs', 'test']),
- install_requires=[
- 'ujson>=3.0.0',
- ],
- extras_require={
- 'test': ['pylint', 'pycodestyle', 'pyflakes', 'pytest',
- 'pytest-cov', 'coverage'],
- },
-)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/test/test_endpoint.py
new/python-lsp-jsonrpc-1.1.2/test/test_endpoint.py
--- old/python-lsp-jsonrpc-1.0.0/test/test_endpoint.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/test/test_endpoint.py 2022-01-10
22:19:15.000000000 +0100
@@ -332,7 +332,7 @@
def await_assertion(condition, timeout=3.0, interval=0.1, exc=None):
if timeout <= 0:
- raise exc if exc else AssertionError("Failed to wait for condition %s"
% condition)
+ raise exc if exc else AssertionError(f"Failed to wait for condition
{condition}")
try:
condition()
except AssertionError as e:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-lsp-jsonrpc-1.0.0/test/test_streams.py
new/python-lsp-jsonrpc-1.1.2/test/test_streams.py
--- old/python-lsp-jsonrpc-1.0.0/test/test_streams.py 2021-04-14
23:05:37.000000000 +0200
+++ new/python-lsp-jsonrpc-1.1.2/test/test_streams.py 2023-09-23
19:46:03.000000000 +0200
@@ -82,13 +82,20 @@
'method': 'method',
'params': {}
})
-
- assert wfile.getvalue() == (
- b'Content-Length: 44\r\n'
- b'Content-Type: application/vscode-jsonrpc; charset=utf8\r\n'
- b'\r\n'
- b'{"id":"hello","method":"method","params":{}}'
- )
+ if 'ujson' in sys.modules:
+ assert wfile.getvalue() == (
+ b'Content-Length: 44\r\n'
+ b'Content-Type: application/vscode-jsonrpc; charset=utf8\r\n'
+ b'\r\n'
+ b'{"id":"hello","method":"method","params":{}}'
+ )
+ else:
+ assert wfile.getvalue() == (
+ b'Content-Length: 49\r\n'
+ b'Content-Type: application/vscode-jsonrpc; charset=utf8\r\n'
+ b'\r\n'
+ b'{"id": "hello", "method": "method", "params": {}}'
+ )
class JsonDatetime(datetime.datetime):
@@ -98,7 +105,7 @@
dif = int(self.timestamp())
else:
dif = int((self - datetime.datetime(1970, 1, 1)).total_seconds())
- return '{0}'.format(dif)
+ return f'{dif}'
def test_writer_bad_message(wfile, writer):