Skip to content

Commit 18ab1b1

Browse files
add the extra sphinx annotations to refer to Path instances
1 parent 48f1b69 commit 18ab1b1

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

doc/en/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
from textwrap import dedent
2222
from typing import TYPE_CHECKING
2323

24-
from _pytest import __version__ as version
24+
from _pytest import __version__ as full_version
2525

2626

27+
version = full_version.split("+")[0]
28+
2729
if TYPE_CHECKING:
2830
import sphinx.application
2931

@@ -169,7 +171,6 @@
169171
nitpick_ignore = [
170172
# TODO (fix in pluggy?)
171173
("py:class", "HookCaller"),
172-
("py:class", "Path"), # figure how to map to interpshinx
173174
("py:class", "HookspecMarker"),
174175
("py:exc", "PluginValidationError"),
175176
# Might want to expose/TODO (https://github.com/pytest-dev/pytest/issues/7469)

src/_pytest/hookspec.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def pytest_ignore_collect(
321321
Stops at first non-None result, see :ref:`firstresult`.
322322
323323
:param collection_path: The path to analyze.
324+
:type collection_path: pathlib.Path
324325
:param path: The path to analyze (deprecated).
325326
:param config: The pytest config object.
326327
@@ -354,6 +355,7 @@ def pytest_collect_directory(path: Path, parent: Collector) -> Collector | None:
354355
Stops at first non-None result, see :ref:`firstresult`.
355356
356357
:param path: The path to analyze.
358+
:type path: pathlib.Path
357359
358360
See :ref:`custom directory collectors` for a simple example of use of this
359361
hook.
@@ -386,6 +388,7 @@ def pytest_collect_file(
386388
The new node needs to have the specified ``parent`` as a parent.
387389
388390
:param file_path: The path to analyze.
391+
:type file_path: pathlib.Path
389392
:param path: The path to collect (deprecated).
390393
391394
.. versionchanged:: 7.0.0
@@ -507,6 +510,7 @@ def pytest_pycollect_makemodule(
507510
Stops at first non-None result, see :ref:`firstresult`.
508511
509512
:param module_path: The path of the module to collect.
513+
:type module_path: pathlib.Path
510514
:param path: The path of the module to collect (deprecated).
511515
512516
.. versionchanged:: 7.0.0
@@ -1026,6 +1030,7 @@ def pytest_report_header( # type:ignore[empty-body]
10261030
10271031
:param config: The pytest config object.
10281032
:param start_path: The starting dir.
1033+
:type start_path: pathlib.Path
10291034
:param startdir: The starting dir (deprecated).
10301035
10311036
.. note::
@@ -1069,6 +1074,7 @@ def pytest_report_collectionfinish( # type:ignore[empty-body]
10691074
10701075
:param config: The pytest config object.
10711076
:param start_path: The starting dir.
1077+
:type start_path: pathlib.Path
10721078
:param startdir: The starting dir (deprecated).
10731079
:param items: List of pytest items that are going to be executed; this list should not be modified.
10741080

src/_pytest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def from_parent( # type: ignore[override]
510510
511511
:param parent: The parent collector of this Dir.
512512
:param path: The directory's path.
513-
:type path: :ref:`python:pathlib.Path`
513+
:type path: pathlib.Path
514514
"""
515515
return super().from_parent(parent=parent, path=path)
516516

tox.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ commands =
9292
# the '-t changelog_towncrier_draft' tags makes sphinx include the draft
9393
# changelog in the docs; this does not happen on ReadTheDocs because it uses
9494
# the standard sphinx command so the 'changelog_towncrier_draft' is never set there
95-
sphinx-build -W --keep-going -b html doc/en doc/en/_build/html -t changelog_towncrier_draft {posargs:}
95+
sphinx-build \
96+
-j auto \
97+
-W --keep-going \
98+
-b html doc/en doc/en/_build/html \
99+
-t changelog_towncrier_draft {posargs:}
96100
setenv =
97101
# Sphinx is not clean of this warning.
98102
PYTHONWARNDEFAULTENCODING=

0 commit comments

Comments
 (0)