diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index e6c59df09..6a28432e3 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -18,6 +18,7 @@ import sys import tempfile import traceback import unicodedata +import warnings from codecs import BOM_UTF8 from collections import deque from datetime import datetime @@ -29,6 +30,7 @@ from six import text_type, binary_type, itervalues from six.moves import range from six.moves.urllib.parse import urlsplit, urlunsplit, quote_plus, parse_qsl, urlencode +from sphinx.deprecation import RemovedInSphinx30Warning from sphinx.errors import PycodeError, SphinxParallelError, ExtensionError from sphinx.util import logging from sphinx.util.console import strip_colors, colorize, bold, term_width_line # type: ignore @@ -172,6 +174,9 @@ def copy_static_entry(source, targetdir, builder, context={}, Handles all possible cases of files, directories and subdirectories. """ + warnings.warn('sphinx.util.copy_static_entry is deprecated for removal', + RemovedInSphinx30Warning) + if exclude_matchers: relpath = relative_path(path.join(builder.srcdir, 'dummy'), source) for matcher in exclude_matchers: diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index b52fde0d6..21464bbe6 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -19,11 +19,14 @@ import re import shutil import sys import time +import warnings from io import BytesIO, StringIO from os import path from six import PY2, PY3, text_type +from sphinx.deprecation import RemovedInSphinx30Warning + if False: # For type annotation from typing import Any, Iterator, List, Tuple, Union # NOQA @@ -181,8 +184,10 @@ def make_filename(string): def ustrftime(format, *args): # type: (unicode, Any) -> unicode - # [DEPRECATED] strftime for unicode strings - # It will be removed at Sphinx-1.5 + """[DEPRECATED] strftime for unicode strings.""" + warnings.warn('sphinx.util.osutil.ustrtime is deprecated for removal', + RemovedInSphinx30Warning) + if not args: # If time is not specified, try to use $SOURCE_DATE_EPOCH variable # See https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal