diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 4db28b1..6811279 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -18,19 +18,16 @@ jobs: OS: 'linux' timeout-minutes: 2 steps: - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: static-pip-${{ hashFiles('setup.py') }} restore-keys: static-pip- - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 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 diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 8049e99..846c70f 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -23,17 +23,16 @@ jobs: PYTHON_VERSION: ['3.10', '3.9', '3.8'] timeout-minutes: 10 steps: - - uses: actions/cache@v1 + - uses: actions/cache@v4 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 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 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 diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index 38723f9..a0fcbce 100644 --- a/.github/workflows/test-mac.yml +++ b/.github/workflows/test-mac.yml @@ -12,7 +12,7 @@ on: jobs: build: name: Mac Py${{ matrix.PYTHON_VERSION }} - runs-on: macos-latest + runs-on: macos-13 env: CI: 'true' OS: 'macos' @@ -23,17 +23,16 @@ jobs: PYTHON_VERSION: ['3.10', '3.9', '3.8'] timeout-minutes: 10 steps: - - uses: actions/cache@v1 + - uses: actions/cache@v4 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 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 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 diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 9785fb2..a089f1b 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -23,16 +23,15 @@ jobs: PYTHON_VERSION: ['3.10', '3.9', '3.8'] timeout-minutes: 10 steps: - - uses: actions/cache@v1 + - uses: actions/cache@v4 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 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 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 --git a/CHANGELOG.md b/CHANGELOG.md index fb0d196..45bc81a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # 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 diff --git a/test/test_streams.py b/test/test_streams.py index 8ded7fe..14fe1bb 100644 --- a/test/test_streams.py +++ b/test/test_streams.py @@ -82,13 +82,20 @@ def test_writer(wfile, writer): '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):