Skip to content

Commit eb03d43

Browse files
authored
PR: Update package name, remove Python 2 compatibility and update CIs (#2)
1 parent 73ab099 commit eb03d43

27 files changed

+275
-2677
lines changed

.circleci/config.yml

-57
This file was deleted.

.coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[run]
2-
omit = pyls_jsonrpc/_version.py
2+
omit = pylsp_jsonrpc/_version.py

.github/workflows/static.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Static code analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
build:
14+
name: Static code analysis
15+
runs-on: ubuntu-latest
16+
env:
17+
CI: 'true'
18+
OS: 'linux'
19+
timeout-minutes: 2
20+
steps:
21+
- uses: actions/cache@v1
22+
with:
23+
path: ~/.cache/pip
24+
key: static-pip-${{ hashFiles('setup.py') }}
25+
restore-keys: static-pip-
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-python@v2
28+
with:
29+
# TODO: check with Python 3, but need to fix the
30+
# errors first
31+
python-version: '3.6'
32+
architecture: 'x64'
33+
- run: python -m pip install --upgrade pip setuptools
34+
- run: pip install -e .[test]
35+
- name: Pylint checks
36+
run: pylint pylsp_jsonrpc test
37+
- name: Code style checks
38+
run: pycodestyle pylsp_jsonrpc test
39+
- name: Pyflakes checks
40+
run: pyflakes pylsp_jsonrpc test

.github/workflows/test-linux.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Linux tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
build:
14+
name: Linux Py${{ matrix.PYTHON_VERSION }}
15+
runs-on: ubuntu-latest
16+
env:
17+
CI: 'true'
18+
OS: 'linux'
19+
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6']
24+
timeout-minutes: 10
25+
steps:
26+
- uses: actions/cache@v1
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('setup.py') }}
30+
restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.PYTHON_VERSION }}
35+
architecture: 'x64'
36+
- run: python -m pip install --upgrade pip setuptools
37+
- run: pip install -e .[all,test]
38+
- run: pytest -v test/
39+
# Enable this if SSH debugging is required
40+
# - name: Setup tmate session
41+
# uses: mxschmitt/action-tmate@v3
42+
# if: ${{ failure() }}

.github/workflows/test-mac.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Mac tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
build:
14+
name: Mac Py${{ matrix.PYTHON_VERSION }}
15+
runs-on: macos-latest
16+
env:
17+
CI: 'true'
18+
OS: 'macos'
19+
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6']
24+
timeout-minutes: 10
25+
steps:
26+
- uses: actions/cache@v1
27+
with:
28+
path: ~/Library/Caches/pip
29+
key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('setup.py') }}
30+
restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.PYTHON_VERSION }}
35+
architecture: 'x64'
36+
- run: python -m pip install --upgrade pip setuptools
37+
- run: pip install -e .[all,test]
38+
- run: pytest -v test/
39+
# Enable this if SSH debugging is required
40+
# - name: Setup tmate session
41+
# uses: mxschmitt/action-tmate@v3
42+
# if: ${{ failure() }}

.github/workflows/test-win.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Windows tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
build:
14+
name: Win Py${{ matrix.PYTHON_VERSION }}
15+
runs-on: windows-latest
16+
env:
17+
CI: 'true'
18+
OS: 'win'
19+
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6']
24+
timeout-minutes: 10
25+
steps:
26+
- uses: actions/cache@v1
27+
with:
28+
path: ~\AppData\Local\pip\Cache
29+
key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('setup.py') }}
30+
restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.PYTHON_VERSION }}
35+
architecture: 'x64'
36+
- run: python -m pip install --upgrade pip setuptools
37+
- run: pip install -e .[all,test]
38+
- run: pytest -v test/

.policy.yml

-100
This file was deleted.

LICENSE

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright 2017 Palantir Technologies, Inc.
3+
Copyright 2017-2020 Palantir Technologies, Inc.
4+
Copyright 2021 Python Language Server Contributors.
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include README.rst
2-
include versioneer.py
3-
include pyls_jsonrpc/_version.py
42
include LICENSE
53
include .pylintrc
4+
include pylsp_jsonrpc/_version.py
65
recursive-include test *.py

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python JSON RPC Server
2+
3+
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.
4+
5+
## Installation
6+
7+
pip install -U python-jsonrpc-server
8+
9+
## Examples
10+
11+
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.
12+
13+
Start by installing `tornado` and `python-language-server`
14+
15+
pip install python-lsp-server[all] tornado
16+
17+
Then running `python examples/langserver.py` or `python examples/langserver_ext.py` will host a websocket on ``ws://localhost:3000/python``.

0 commit comments

Comments
 (0)