diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 7a7f2f6e..543744a6 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.11', '3.10', '3.9'] + PYTHON_VERSION: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9'] timeout-minutes: 10 steps: - uses: actions/cache@v4 diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index a92c82a8..7b06ad26 100644 --- a/.github/workflows/test-mac.yml +++ b/.github/workflows/test-mac.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.11', '3.10', '3.9'] + PYTHON_VERSION: ['3.14', '3.12', '3.9'] timeout-minutes: 10 steps: - uses: actions/cache@v4 diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 8ecd3429..fa71c5ce 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.11', '3.10', '3.9'] + PYTHON_VERSION: ['3.14', '3.12', '3.9'] timeout-minutes: 10 steps: - uses: actions/cache@v4 diff --git a/pylsp/python_lsp.py b/pylsp/python_lsp.py index a2640666..bdc072d4 100644 --- a/pylsp/python_lsp.py +++ b/pylsp/python_lsp.py @@ -4,6 +4,7 @@ import logging import os import socketserver +import sys import threading import uuid from functools import partial @@ -71,9 +72,13 @@ def shutdown_server(check_parent_process, *args): handler_class.__name__ + "Handler", (_StreamHandlerWrapper,), { - "DELEGATE_CLASS": partial( - handler_class, check_parent_process=check_parent_process - ), + # We need to wrap this in staticmethod due to the changes to + # functools.partial in Python 3.14+ + "DELEGATE_CLASS": staticmethod( + partial(handler_class, check_parent_process=check_parent_process) + ) + if sys.version_info >= (3, 14) + else partial(handler_class, check_parent_process=check_parent_process), "SHUTDOWN_CALL": partial(shutdown_server, check_parent_process), }, ) diff --git a/test/plugins/test_flake8_lint.py b/test/plugins/test_flake8_lint.py index d8199d63..ad1dc4ff 100644 --- a/test/plugins/test_flake8_lint.py +++ b/test/plugins/test_flake8_lint.py @@ -126,7 +126,7 @@ def test_flake8_config_param(workspace) -> None: with patch("pylsp.plugins.flake8_lint.Popen") as popen_mock: mock_instance = popen_mock.return_value mock_instance.communicate.return_value = [b"", b""] - flake8_conf = "/tmp/some.cfg" + flake8_conf = "C:\\some.cfg" if os.name == "nt" else "/tmp/some.cfg" workspace._config.update({"plugins": {"flake8": {"config": flake8_conf}}}) _name, doc = temp_document(DOC, workspace) flake8_lint.pylsp_lint(workspace, doc)