diff --git a/CHANGES b/CHANGES index c363a75b2..ffb4c78aa 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Release 4.4.0 (in development) Dependencies ------------ +* #10007: Use ``importlib_metadata`` for python-3.9 or older +* #10007: Drop ``setuptools`` + Incompatible changes -------------------- @@ -13,7 +16,7 @@ Deprecated Features added -------------- -* #9075: autodoc: Add a config variable :confval:`autodoc_unqualified_typehints` +* #9075: autodoc: Add a config variable :confval:`autodoc_typehints_format` to suppress the leading module names of typehints of function signatures (ex. ``io.StringIO`` -> ``StringIO``) * #9831: Autosummary now documents only the members specified in a module's diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index d775ddee8..dfb08e688 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -662,10 +662,15 @@ There are also config values that you can set: .. __: https://mypy.readthedocs.io/en/latest/kinds_of_types.html#type-aliases .. versionadded:: 3.3 -.. confval:: autodoc_unqualified_typehints +.. confval:: autodoc_typehints_format - If True, the leading module names of typehints of function signatures are - removed (ex. ``io.StringIO`` -> ``StringIO``). Defaults to False. + This value controls the format of typehints. The setting takes the + following values: + + * ``'fully-qualified'`` -- Show the module name and its name of typehints + (default) + * ``'short'`` -- Suppress the leading module names of the typehints + (ex. ``io.StringIO`` -> ``StringIO``) .. versionadded:: 4.4 diff --git a/setup.py b/setup.py index 44da14d09..c0a9c2b0d 100644 --- a/setup.py +++ b/setup.py @@ -29,8 +29,8 @@ install_requires = [ 'alabaster>=0.7,<0.8', 'imagesize', 'requests>=2.5.0', - 'setuptools', 'packaging', + "importlib-metadata>=4.4; python_version < '3.10'", ] extras_require = { @@ -47,7 +47,6 @@ extras_require = { 'mypy>=0.930', 'docutils-stubs', "types-typed-ast", - "types-pkg_resources", "types-requests", ], 'test': [ diff --git a/sphinx/application.py b/sphinx/application.py index 475f08853..a26c3d659 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -933,14 +933,18 @@ class Sphinx: def add_js_file(self, filename: str, priority: int = 500, **kwargs: Any) -> None: """Register a JavaScript file to include in the HTML output. - Add *filename* to the list of JavaScript files that the default HTML - template will include in order of *priority* (ascending). The filename - must be relative to the HTML static path , or a full URI with scheme. - If the priority of the JavaScript file is the same as others, the JavaScript - files will be included in order of registration. If the keyword - argument ``body`` is given, its value will be added between the - ``