Skip to content

Commit

Permalink
Merge pull request #10040 from tk0miya/9595_deprecate_setuptools_inte…
Browse files Browse the repository at this point in the history
…gration

Close #9595: Deprecate setuptools integration
  • Loading branch information
tk0miya committed Jan 3, 2022
2 parents 3cb680a + fe338f6 commit b5ef099
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -25,6 +25,8 @@ Incompatible changes
Deprecated
----------

* setuptools integration. The ``build_sphinx`` sub-command for setup.py is
marked as deprecated to follow the policy of setuptools team.
* ``sphinx.writers.latex.LaTeXWriter.docclasses``

Features added
Expand Down
5 changes: 5 additions & 0 deletions doc/extdev/deprecated.rst
Expand Up @@ -22,6 +22,11 @@ The following is a list of deprecated interfaces.
- (will be) Removed
- Alternatives

* - :doc:`Setuptools integration </usage/advanced/setuptools>`
- 5.0
- 7.0
- N/A

* - ``sphinx.writers.latex.LaTeXWriter.docclasses``
- 5.0
- 7.0
Expand Down
4 changes: 4 additions & 0 deletions doc/usage/advanced/setuptools.rst
Expand Up @@ -6,6 +6,10 @@ Setuptools integration
Sphinx supports integration with setuptools and distutils through a custom
command - :class:`~sphinx.setup_command.BuildDoc`.

.. deprecated:: 5.0

This feature will be removed in v7.0.

Using setuptools integration
----------------------------

Expand Down
5 changes: 5 additions & 0 deletions sphinx/setup_command.py
Expand Up @@ -13,13 +13,15 @@

import os
import sys
import warnings
from distutils.cmd import Command
from distutils.errors import DistutilsExecError
from io import StringIO
from typing import Any, Dict

from sphinx.application import Sphinx
from sphinx.cmd.build import handle_exception
from sphinx.deprecation import RemovedInSphinx70Warning
from sphinx.util.console import color_terminal, nocolor
from sphinx.util.docutils import docutils_namespace, patch_docutils
from sphinx.util.osutil import abspath
Expand Down Expand Up @@ -140,6 +142,9 @@ def finalize_options(self) -> None:
for builder in self.builder]

def run(self) -> None:
warnings.warn('setup.py build_sphinx is deprecated.',
RemovedInSphinx70Warning, stacklevel=2)

if not color_terminal():
nocolor()
if not self.verbose: # type: ignore
Expand Down

0 comments on commit b5ef099

Please sign in to comment.