Skip to content

Commit

Permalink
Use the _StrPath proxy for sphinx.builders
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 27, 2024
1 parent 3930a1c commit 40dc8b8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sphinx/builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
rst,
)
from sphinx.util._importer import import_object
from sphinx.util._pathlib import _StrPathProperty
from sphinx.util.build_phase import BuildPhase
from sphinx.util.console import bold
from sphinx.util.display import progress_message, status_iterator
Expand All @@ -48,7 +49,6 @@
from sphinx.application import Sphinx
from sphinx.config import Config
from sphinx.events import EventManager
from sphinx.util._pathlib import _StrPath
from sphinx.util.tags import Tags


Expand Down Expand Up @@ -94,11 +94,16 @@ class Builder:
#: The file format produced by the builder allows images to be embedded using data-URIs.
supported_data_uri_images: bool = False

srcdir = _StrPathProperty()
confdir = _StrPathProperty()
outdir = _StrPathProperty()
doctreedir = _StrPathProperty()

def __init__(self, app: Sphinx, env: BuildEnvironment) -> None:
self.srcdir: _StrPath = app.srcdir
self.confdir: _StrPath = app.confdir
self.outdir: _StrPath = app.outdir
self.doctreedir: _StrPath = app.doctreedir
self.srcdir = app.srcdir
self.confdir = app.confdir
self.outdir = app.outdir
self.doctreedir = app.doctreedir
ensuredir(self.doctreedir)

self.app: Sphinx = app
Expand Down

0 comments on commit 40dc8b8

Please sign in to comment.