Skip to content

Commit

Permalink
Declare extension safe for parallel reads (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSCU-CNI authored Jun 18, 2024
1 parent 0f6a874 commit fb59f64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
## Unreleased

- Allow to add content to directive.
- Fix Sphinx warnings about parallel reads.

## 1.13.1

Expand Down
6 changes: 4 additions & 2 deletions src/sphinx_argparse_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Any

from .version import __version__

if TYPE_CHECKING:
from sphinx.application import Sphinx


def setup(app: Sphinx) -> None:
def setup(app: Sphinx) -> dict[str, Any]:
app.add_css_file("custom.css")

from ._logic import SphinxArgparseCli

app.add_directive(SphinxArgparseCli.name, SphinxArgparseCli)
app.add_config_value("sphinx_argparse_cli_prefix_document", False, "env") # noqa: FBT003

return {"parallel_read_safe": True}


__all__ = [
"__version__",
Expand Down

0 comments on commit fb59f64

Please sign in to comment.