Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ubmarco committed Mar 15, 2024
1 parent 3b42a05 commit d9b2de7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ General configuration
the parallel write phase. When active, the event :event:`doctree-resolved` as
well as the builder function ``write_doc_serialized`` also run in parallel.
Parallel post-transformation can greatly improve build time for extensions that
do heave computation in that phase. Depending on machine core count and project
do heavy computation in that phase. Depending on machine core count and project
size, a build time reduction by a factor of 2 to 4 and even more was observed.
The feature flag does nothing in case parallel writing is not used.

Expand Down
2 changes: 2 additions & 0 deletions sphinx/testing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def app(
"""
args, kwargs = app_params
app_ = make_app(*args, **kwargs)
app_.env.config.enable_parallel_post_transform = True
yield app_

print('# testroot:', kwargs.get('testroot', 'root'))
Expand Down Expand Up @@ -189,6 +190,7 @@ def make(*args: Any, **kwargs: Any) -> SphinxTestApp:
kwargs.setdefault('status', status)
kwargs.setdefault('warning', warning)
app_: Any = SphinxTestApp(*args, **kwargs)
# app_.env.config.enable_parallel_post_transform = True
apps.append(app_)
if test_params['shared_result']:
app_ = SphinxTestAppWrapperForSkipBuilding(app_)
Expand Down
4 changes: 2 additions & 2 deletions sphinx/testing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def __init__(
status: IO | None = None,
warning: IO | None = None,
tags: list[str] | None = None,
docutils_conf: str | None = None,
parallel: int = 0,
docutilsconf: str | None = None,
parallel: int = 4,
) -> None:
assert srcdir is not None

Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def make_chunks(arguments: Sequence[str], nproc: int, maxbatch: int = 10) -> lis
chunksize = nargs // nproc
if chunksize >= maxbatch:
# try to improve batch size vs. number of batches
chunksize = int(sqrt(nargs / nproc * maxbatch))
chunksize = int(sqrt(sqrt(nargs / nproc * maxbatch)))
if chunksize == 0:
chunksize = 1
nchunks, rest = divmod(nargs, chunksize)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ setenv =
PYTHONWARNINGS = error
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:} --color yes
commands=
python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs}
python -X dev -X warn_default_encoding -m pytest -n 4 --durations 25 {posargs}

[testenv:docs]
basepython = python3
Expand Down

0 comments on commit d9b2de7

Please sign in to comment.