Skip to content

docs: fix PathLike warning breaking the strict docs build#5310

Merged
xrmx merged 1 commit into
open-telemetry:mainfrom
MikeGoldsmith:mike/fix-docs-pathlike-warning
Jun 17, 2026
Merged

docs: fix PathLike warning breaking the strict docs build#5310
xrmx merged 1 commit into
open-telemetry:mainfrom
MikeGoldsmith:mike/fix-docs-pathlike-warning

Conversation

@MikeGoldsmith

Copy link
Copy Markdown
Member

Description

The file exporter added in #5207 annotates its constructors with
path: str | PathLike[str] using from os import PathLike. sphinx_autodoc_typehints
renders this as the bare name PathLike, which (under nitpicky = True) cannot be
resolved to os.PathLike. This makes the strict docs build (sphinx-build -W) fail:

WARNING: py:class reference target not found: PathLike

across FileSpanExporter, FileMetricExporter, and FileLogExporter.

This adds ("py:class", "PathLike") to nitpick_ignore in docs/conf.py, consistent
with how the repo already handles other unresolvable stdlib/third-party targets
(Token, ObjectProxy, Union, etc.).

Verification

uv run tox -e docs (the same -W build CI runs) now succeeds.

Type of change

  • Documentation / build fix

The file exporter (open-telemetry#5207) type hints use ``from os import PathLike``, which
sphinx renders as the bare name ``PathLike`` and cannot resolve, failing the
strict (-W) docs build. Add it to nitpick_ignore alongside the other
unresolvable stdlib/third-party targets.
@MikeGoldsmith
MikeGoldsmith requested a review from a team as a code owner June 16, 2026 12:16
@MikeGoldsmith MikeGoldsmith added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 16, 2026
@MikeGoldsmith MikeGoldsmith moved this to Easy to review / merge / close in Python PR digest Jun 16, 2026
@github-project-automation github-project-automation Bot moved this from Easy to review / merge / close to Approved PRs in Python PR digest Jun 16, 2026
@xrmx xrmx moved this from Approved PRs to Ready for merge in Python PR digest Jun 17, 2026
@xrmx
xrmx added this pull request to the merge queue Jun 17, 2026
Merged via the queue into open-telemetry:main with commit 4c8569d Jun 17, 2026
520 of 521 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for merge to Done in Python PR digest Jun 17, 2026
@MikeGoldsmith
MikeGoldsmith deleted the mike/fix-docs-pathlike-warning branch June 17, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants