Skip to content

Commit 44f7eb0

Browse files
authored
Fix starting the server for Python 3.14 and run tests with that version (#690)
1 parent ab1b069 commit 44f7eb0

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/workflows/test-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
PYTHON_VERSION: ['3.11', '3.10', '3.9']
27+
PYTHON_VERSION: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9']
2828
timeout-minutes: 10
2929
steps:
3030
- uses: actions/cache@v4

.github/workflows/test-mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
PYTHON_VERSION: ['3.11', '3.10', '3.9']
27+
PYTHON_VERSION: ['3.14', '3.12', '3.9']
2828
timeout-minutes: 10
2929
steps:
3030
- uses: actions/cache@v4

.github/workflows/test-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
PYTHON_VERSION: ['3.11', '3.10', '3.9']
27+
PYTHON_VERSION: ['3.14', '3.12', '3.9']
2828
timeout-minutes: 10
2929
steps:
3030
- uses: actions/cache@v4

pylsp/python_lsp.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import os
66
import socketserver
7+
import sys
78
import threading
89
import uuid
910
from functools import partial
@@ -71,9 +72,13 @@ def shutdown_server(check_parent_process, *args):
7172
handler_class.__name__ + "Handler",
7273
(_StreamHandlerWrapper,),
7374
{
74-
"DELEGATE_CLASS": partial(
75-
handler_class, check_parent_process=check_parent_process
76-
),
75+
# We need to wrap this in staticmethod due to the changes to
76+
# functools.partial in Python 3.14+
77+
"DELEGATE_CLASS": staticmethod(
78+
partial(handler_class, check_parent_process=check_parent_process)
79+
)
80+
if sys.version_info >= (3, 14)
81+
else partial(handler_class, check_parent_process=check_parent_process),
7782
"SHUTDOWN_CALL": partial(shutdown_server, check_parent_process),
7883
},
7984
)

test/plugins/test_flake8_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_flake8_config_param(workspace) -> None:
126126
with patch("pylsp.plugins.flake8_lint.Popen") as popen_mock:
127127
mock_instance = popen_mock.return_value
128128
mock_instance.communicate.return_value = [b"", b""]
129-
flake8_conf = "/tmp/some.cfg"
129+
flake8_conf = "C:\\some.cfg" if os.name == "nt" else "/tmp/some.cfg"
130130
workspace._config.update({"plugins": {"flake8": {"config": flake8_conf}}})
131131
_name, doc = temp_document(DOC, workspace)
132132
flake8_lint.pylsp_lint(workspace, doc)

0 commit comments

Comments
 (0)