Skip to content

Commit

Permalink
Merge branch 'master' into search-button
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Jul 22, 2024
2 parents 25a7275 + 45f3cd6 commit c144e17
Show file tree
Hide file tree
Showing 73 changed files with 2,880 additions and 3,138 deletions.
130 changes: 127 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,125 @@
Release 8.0.0 (in development)
==============================

Dependencies
------------

Incompatible changes
--------------------

.. rst-class:: compact

* Remove deprecated functions from ``sphinx.util``:

* Removed ``sphinx.util.path_stabilize``
(use ``sphinx.util.osutil.path_stabilize``).
* Removed ``sphinx.util.display_chunk``
(use ``sphinx.util.display.display_chunk``).
* Removed ``sphinx.util.status_iterator``
(use ``sphinx.util.display.status_iterator``).
* Removed ``sphinx.util.SkipProgressMessage``
(use ``sphinx.util.display.SkipProgressMessage``).
* Removed ``sphinx.util.progress_message``
(use ``sphinx.util.display.progress_message``).
* Removed ``sphinx.util.epoch_to_rfc1123``
(use ``sphinx.http_date.epoch_to_rfc1123``).
* Removed ``sphinx.util.rfc1123_to_epoch``
(use ``sphinx.http_date.rfc1123_to_epoch``).
* Removed ``sphinx.util.save_traceback``
(use ``sphinx.exceptions.save_traceback``).
* Removed ``sphinx.util.format_exception_cut_frames``
(use ``sphinx.exceptions.format_exception_cut_frames``).
* Removed ``sphinx.util.xmlname_checker``
(use ``sphinx.builders.epub3._XML_NAME_PATTERN``).

Patch by Adam Turner.
* Removed :py:func:`!sphinx.util.osutil.cd`
(use :py:func:`contextlib.chdir`).
Patch by Adam Turner.
* Removed :py:func:`!sphinx.util.typing.stringify`
(use :py:func:`!sphinx.util.typing.stringify_annotation`).
Patch by Adam Turner.
* #12593: Raise an error for invalid :confval:`html_sidebars` values.
Patch by Adam Turner.
* #12593: Raise an error in :py:func:`!Theme.get_config` for invalid sections.
Patch by Adam Turner.
* #11693: Remove support for old-style :file:`Makefile` and :file:`make.bat`
output in :program:`sphinx-quickstart`.
* #11693: Remove the :option:`!--no-use-make-mode`, :option:`!-M`,
:option:`!--use-make-mode`, and :option:`!-m` options
from :program:`sphinx-quickstart`.
Patch by Adam Turner.
* Removed the tuple interface to :py:class:`!sphinx.ext.autodoc.ObjectMember`.
Patch by Adam Turner.
* #12630: Sphinx 8 makes two changes to the ``linkcheck`` configuration defaults:

* :confval:`linkcheck_allow_unauthorized` is now ``False`` by default.
* :confval:`linkcheck_report_timeouts_as_broken` is now ``False`` by default.

Patch by James Addison.
* #12597: Change the default of :confval:`show_warning_types`
from ``False`` to ``True``.
Patch by Chris Sewell.

Deprecated
----------

Features added
--------------

Bugs fixed
----------

Testing
-------

Release 7.4.7 (released Jul 20, 2024)
=====================================

Bugs fixed
----------

* #12096: Warn when files are overwritten in the build directory.
Patch by Adam Turner and Bénédikt Tran.
* #12620: Ensure that old-style object description options are respected.
Patch by Adam Turner.
* #12601, #12625: Support callable objects in :py:class:`~typing.Annotated` type
metadata in the Python domain.
Patch by Adam Turner.
* #12601, #12622: Resolve :py:class:`~typing.Annotated` warnings with
``sphinx.ext.autodoc``,
especially when using :mod:`dataclasses` as type metadata.
Patch by Adam Turner.
* #12589, #12626: autosummary: Fix warnings with :rst:role:`!autolink`.
Patch by Adam Turner.

Release 7.4.6 (released Jul 18, 2024)
=====================================

Bugs fixed
----------

* #12589, #9743, #12609: autosummary: Do not add the package prefix when
generating autosummary directives for modules within a package.
Patch by Adam Turner.
* #12613: Reduce log severity for ambiguity detection during inventory loading.
Patch by James Addison.

Release 7.4.5 (released Jul 16, 2024)
=====================================

Bugs fixed
----------

* #12593, #12600: Revert coercing the type of selected :confval:`html_sidebars`
values to a list.
Log an error message when string values are detected.
Patch by Adam Turner.
* #12594: LaTeX: since 7.4.0, :rst:dir:`seealso` and other "light" admonitions
now break PDF builds if they contain a :dudir:`figure` directive; and also
if they are contained in a table cell (rendered by ``tabulary``).
Patch by Jean-François B.

Release 7.4.4 (released Jul 15, 2024)
=====================================

Expand Down Expand Up @@ -159,11 +281,13 @@ Bugs fixed
Patch by Matthias Geier.
* #12224: Properly detect WebP files.
Patch by Benjamin Cabé.
* #12380: LaTeX: Footnote mark sometimes indicates ``Page N`` where ``N`` is
the current page number and the footnote does appear on that same page.
* #12380: LaTeX: Avoid footnote markers ``Page N`` when ``N`` is already
the current page number.
Patch by Jean-François B.
* #12410: LaTeX: for French and ``'lualatex'`` as :confval:`latex_engine`
``polyglossia`` and not ``babel`` is used (contrarily to ``'xelatex'``).
use ``babel`` as with ``'xelatex'`` (and not ``polyglossia``).
Patch by Jean-François B.
* #12520: LaTeX: let :rst:dir:`todolist` produce correct hyperlinks in PDF.
Patch by Jean-François B.
* #12416: Ensure that configuration setting aliases are always synchronised
when one value or the other is modified.
Expand Down
10 changes: 10 additions & 0 deletions doc/_themes/sphinx13/static/sphinx13.css
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ div.sphinxsidebar #searchbox {
margin: 12px 0 20px 0;
}

div.sphinxsidebar #searchbox input[type="text"] {
border-radius: var(--admonition-radius) 0 0 var(--admonition-radius);
}

div.sphinxsidebar #searchbox input[type="submit"] {
border-radius: 0 var(--admonition-radius) var(--admonition-radius) 0;
color: white;
background: var(--colour-sphinx-blue);
}

div.footer {
background-color: var(--colour-sphinx-blue);
color: #ccc;
Expand Down
4 changes: 4 additions & 0 deletions doc/man/sphinx-quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ Options
.. versionchanged:: 7.3
Support for disabling the make-mode will be removed in Sphinx 8.

.. versionremoved:: 8.0
The :option:`!--no-use-make-mode` option.
The :option:`!--use-make-mode` now has no effect.

.. option:: --makefile, --no-makefile

Create (or not create) makefile.
Expand Down
40 changes: 18 additions & 22 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1331,14 +1331,16 @@ Options for warning control

.. confval:: show_warning_types
:type: :code-py:`bool`
:default: :code-py:`False`
:default: :code-py:`True`

Add the type of each warning as a suffix to the warning message.
For example, ``WARNING: [...] [index]`` or ``WARNING: [...] [toc.circular]``.
This setting can be useful for determining which warnings types to include
in a :confval:`suppress_warnings` list.

.. versionadded:: 7.3.0
.. versionchanged:: 8.0.0
The default is now :code-py:`True`.

.. confval:: suppress_warnings
:type: :code-py:`Sequence[str]`
Expand Down Expand Up @@ -3714,20 +3716,17 @@ and the number of workers to use.

.. confval:: linkcheck_allow_unauthorized
:type: :code-py:`bool`
:default: :code-py:`True`
:default: :code-py:`False`

When a webserver responds with an HTTP 401 (unauthorised) response,
the current default behaviour of the *linkcheck* builder is
to treat the link as "working".
To change that behaviour, set this option to :code-py:`False`.

.. attention::
The default value for this option will be changed in Sphinx 8.0;
from that version onwards,
HTTP 401 responses to checked hyperlinks will be treated
as "broken" by default.
to treat the link as "broken".
To change that behaviour, set this option to :code-py:`True`.

.. xref RemovedInSphinx80Warning
.. versionchanged:: 8.0
The default value for this option changed to :code-py:`False`,
meaning HTTP 401 responses to checked hyperlinks
are treated as "broken" by default.

.. versionadded:: 7.3

Expand Down Expand Up @@ -3755,21 +3754,18 @@ and the number of workers to use.

.. confval:: linkcheck_report_timeouts_as_broken
:type: :code-py:`bool`
:default: :code-py:`True`
:default: :code-py:`False`

When an HTTP response is not received from a webserver before the configured
:confval:`linkcheck_timeout` expires,
the current default behaviour of the *linkcheck* builder is
to treat the link as 'broken'.
To report timeouts using a distinct report code of ``timeout``,
set :confval:`linkcheck_report_timeouts_as_broken` to :code-py:`False`.
If :confval:`linkcheck_timeout` expires while waiting for a response from
a hyperlink, the *linkcheck* builder will report the link as a ``timeout``
by default. To report timeouts as ``broken`` instead, you can
set :confval:`linkcheck_report_timeouts_as_broken` to :code-py:`True`.

.. attention::
From Sphinx 8.0 onwards, timeouts that occur while checking hyperlinks
.. versionchanged:: 8.0
The default value for this option changed to :code-py:`False`,
meaning timeouts that occur while checking hyperlinks
will be reported using the new 'timeout' status code.

.. xref RemovedInSphinx80Warning
.. versionadded:: 7.3

.. confval:: linkcheck_request_headers
Expand Down
19 changes: 12 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ docs = [
]
lint = [
"flake8>=6.0",
"ruff==0.5.2",
"ruff==0.5.4",
"mypy==1.10.1",
"sphinx-lint>=0.9",
"types-colorama==0.4.15.20240311",
"types-docutils==0.21.0.20240711",
"types-Pillow==10.2.0.20240520",
"types-Pygments==2.18.0.20240506",
"types-requests>=2.30.0", # align with requests
"importlib-metadata>=6.0", # for mypy (Python<=3.9)
"tomli>=2", # for mypy (Python<=3.10)
Expand Down Expand Up @@ -224,9 +227,6 @@ enable_error_code = [
"ignore-without-code",
"unused-awaitable",
]
disable_error_code = [
"import-untyped",
]

[[tool.mypy.overrides]]
module = [
Expand All @@ -244,16 +244,13 @@ strict_optional = false
[[tool.mypy.overrides]]
module = [
"sphinx.application",
"sphinx.cmd.quickstart",
"sphinx.config",
"sphinx.domains",
"sphinx.domains.c",
"sphinx.domains.cpp",
"sphinx.events",
"sphinx.ext.autodoc",
"sphinx.ext.autodoc.directive",
"sphinx.ext.autodoc.importer",
"sphinx.ext.autosummary.generate",
"sphinx.ext.doctest",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
Expand All @@ -274,6 +271,14 @@ module = [
]
disallow_any_generics = false

[[tool.mypy.overrides]]
module = [
"defusedxml.ElementTree",
"imagesize",
"snowballstemmer",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
Expand Down
6 changes: 3 additions & 3 deletions sphinx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The Sphinx documentation toolchain."""

__version__ = '7.4.4'
__version__ = '8.0.0'
__display_version__ = __version__ # used for command line version

# Keep this file executable as-is in Python 3!
Expand All @@ -27,11 +27,11 @@
#:
#: .. versionadded:: 1.2
#: Before version 1.2, check the string ``sphinx.__version__``.
version_info = (7, 4, 4, 'final', 0)
version_info = (8, 0, 0, 'beta', 0)

package_dir = os.path.abspath(os.path.dirname(__file__))

_in_development = False
_in_development = True
if _in_development:
# Only import subprocess if needed
import subprocess
Expand Down
5 changes: 3 additions & 2 deletions sphinx/builders/_epub_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

try:
from PIL import Image
PILLOW_AVAILABLE = True
except ImportError:
Image = None
PILLOW_AVAILABLE = False


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -440,7 +441,7 @@ def copy_image_files(self) -> None:
"""
if self.images:
if self.config.epub_fix_images or self.config.epub_max_image_width:
if not Image:
if not PILLOW_AVAILABLE:
logger.warning(__('Pillow not found - copying image files'))
super().copy_image_files()
else:
Expand Down
Loading

0 comments on commit c144e17

Please sign in to comment.