Skip to content

Commit ac615f6

Browse files
authored
Merge branch 'develop' into bump-pylint
2 parents d20ec4a + 4ebece5 commit ac615f6

File tree

15 files changed

+108
-22
lines changed

15 files changed

+108
-22
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

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# History of changes
22

3+
## Version 1.13.2 (2025/11/19)
4+
5+
### Pull Requests Merged
6+
7+
* [PR 683](https://github.com/python-lsp/python-lsp-server/pull/683) - Prevent showing cmd on Windows when running flake8, by [@dalthviz](https://github.com/dalthviz)
8+
* [PR 669](https://github.com/python-lsp/python-lsp-server/pull/669) - Fix license entries in `pyproject.toml` due to pep 639, by [@ccordoba12](https://github.com/ccordoba12)
9+
10+
In this release 2 pull requests were closed.
11+
12+
----
13+
314
## Version 1.13.1 (2025/08/26)
415

516
### Pull Requests Merged

CONFIGURATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho
7777
| `pylsp.rope.extensionModules` | `string` | Builtin and c-extension modules that are allowed to be imported and inspected by rope. | `null` |
7878
| `pylsp.rope.ropeFolder` | `array` of unique `string` items | The name of the folder in which rope stores project configurations and data. Pass `null` for not using such a folder at all. | `null` |
7979
| `pylsp.signature.formatter` | `string` (one of: `'black'`, `'ruff'`, `None`) | Formatter to use for reformatting signatures in docstrings. | `"black"` |
80+
| `pylsp.signature.include_docstring` | `boolean` | Include signature docstring. | `true` |
8081
| `pylsp.signature.line_length` | `number` | Maximum line length in signatures. | `88` |
8182

8283
This documentation was generated from `pylsp/config/schema.json`. Please do not edit this file directly.

pylsp/_utils.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,24 @@ def format_docstring(
315315
contents = ""
316316

317317
if markup_kind == "markdown":
318-
try:
319-
value = docstring_to_markdown.convert(contents)
320-
except docstring_to_markdown.UnknownFormatError:
321-
# try to escape the Markdown syntax instead:
322-
value = escape_markdown(contents)
323-
324-
if signatures:
325-
wrapped_signatures = convert_signatures_to_markdown(
326-
signatures, config=signature_config or {}
327-
)
328-
value = wrapped_signatures + "\n\n" + value
318+
wrapped_signatures = convert_signatures_to_markdown(
319+
signatures if signatures is not None else [], config=signature_config or {}
320+
)
321+
322+
if contents != "":
323+
try:
324+
value = docstring_to_markdown.convert(contents)
325+
except docstring_to_markdown.UnknownFormatError:
326+
# try to escape the Markdown syntax instead:
327+
value = escape_markdown(contents)
328+
329+
if signatures:
330+
value = wrapped_signatures + "\n\n" + value
331+
else:
332+
value = contents
333+
334+
if signatures:
335+
value = wrapped_signatures
329336

330337
return {"kind": "markdown", "value": value}
331338
value = contents

pylsp/config/schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@
530530
"default": "black",
531531
"description": "Formatter to use for reformatting signatures in docstrings."
532532
},
533+
"pylsp.signature.include_docstring": {
534+
"type": "boolean",
535+
"default": true,
536+
"description": "Include signature docstring."
537+
},
533538
"pylsp.signature.line_length": {
534539
"type": "number",
535540
"default": 88,

pylsp/plugins/hover.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,19 @@ def pylsp_hover(config, document, position):
4141
"",
4242
)
4343

44+
include_docstring = signature_config.get("include_docstring", True)
45+
46+
# raw docstring returns only doc, without signature
47+
docstring = definition.docstring(raw=True)
48+
if not include_docstring:
49+
if signature:
50+
docstring = ""
51+
else:
52+
docstring = docstring.strip().split("\n")[0].strip()
53+
4454
return {
4555
"contents": _utils.format_docstring(
46-
# raw docstring returns only doc, without signature
47-
definition.docstring(raw=True),
56+
docstring,
4857
preferred_markup_kind,
4958
signatures=[signature] if signature else None,
5059
signature_config=signature_config,

pylsp/plugins/signature.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
@hookimpl
1919
def pylsp_signature_help(config, document, position):
20+
signature_config = config.settings().get("signature", {})
2021
code_position = _utils.position_to_jedi_linecolumn(document, position)
2122
signatures = document.jedi_script().get_signatures(**code_position)
2223

@@ -41,10 +42,15 @@ def pylsp_signature_help(config, document, position):
4142
# Docstring contains one or more lines of signature, followed by empty line, followed by docstring
4243
function_sig_lines = (docstring.split("\n\n") or [""])[0].splitlines()
4344
function_sig = " ".join([line.strip() for line in function_sig_lines])
45+
46+
signature_docstring = s.docstring(raw=True)
47+
if not signature_config.get("include_docstring", True):
48+
signature_docstring = ""
49+
4450
sig = {
4551
"label": function_sig,
4652
"documentation": _utils.format_docstring(
47-
s.docstring(raw=True), markup_kind=preferred_markup_kind
53+
signature_docstring, markup_kind=preferred_markup_kind
4854
),
4955
}
5056

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
)

0 commit comments

Comments
 (0)