Skip to content

Commit 208ac3b

Browse files
committed
fix stubgen
1 parent 39f1b91 commit 208ac3b

4 files changed

Lines changed: 23 additions & 6 deletions

File tree

template/utils/_checks.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def ensure_int(item: Any, item_name: str | None = None) -> int:
1515
item_name : str | None
1616
Name of the item to show inside the error message.
1717
18+
Returns
19+
-------
20+
item : int
21+
Item validated and converted to a Python integer.
22+
1823
Raises
1924
------
2025
TypeError
@@ -76,8 +81,8 @@ def check_value(
7681
When the value of the item is not one of the valid options.
7782
"""
7883

79-
def check_verbose(verbose: Any) -> int:
80-
"""Check that the value of verbose is valid.
84+
def ensure_verbose(verbose: Any) -> int:
85+
"""Ensure that the value of verbose is valid.
8186
8287
Parameters
8388
----------

template/utils/config.pyi

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ from packaging.requirements import Requirement
55

66
from ._checks import check_type as check_type
77

8-
def sys_info(fid: IO | None = None, developer: bool = False):
8+
def sys_info(
9+
fid: IO | None = None,
10+
*,
11+
extra: bool = False,
12+
developer: bool = False,
13+
package: str | None = None,
14+
) -> None:
915
"""Print the system information for debugging.
1016
1117
Parameters
1218
----------
1319
fid : file-like | None
1420
The file to write to, passed to :func:`print`. Can be None to use
1521
:data:`sys.stdout`.
16-
developer : bool
22+
extra : bool
1723
If True, display information about optional dependencies.
24+
developer : bool
25+
If True, display information about optional dependencies. Only available for
26+
the package installed in editable mode.
27+
package : str | None
28+
The package to display information about. If None, display information about the
29+
current package.
1830
"""
1931

2032
def _list_dependencies_info(

template/utils/logs.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from pathlib import Path
44

55
from _typeshed import Incomplete
66

7-
from ._checks import check_verbose as check_verbose
7+
from ._checks import ensure_verbose as ensure_verbose
88
from ._docs import fill_doc as fill_doc
99
from ._fixes import WrapStdOut as WrapStdOut
1010

tools/stubgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
files = [
1717
str(file.as_posix())
1818
for file in directory.rglob("*.py")
19-
if file.parent.name not in ("commands", "tests")
19+
if file.parent.name not in ("_commands", "tests")
2020
and file.name not in ("conftest.py", "_version.py")
2121
]
2222
stubgen.main(

0 commit comments

Comments
 (0)