summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-02-05 21:37:45 +0000
committerStephen Finucane <stephen@that.guru>2018-02-07 11:26:59 +0000
commitd35cda9943ebb6d9657f03a7231963c4f4798787 (patch)
treeb31fc57fc215409a800a6833b2b96fe020e5f6f6
parent05f851fa1907dc14100b1391aa2d692f80426f63 (diff)
downloadsphinx-git-d35cda9943ebb6d9657f03a7231963c4f4798787.tar.gz
util: Mark deprecated functions with warning
This ensures the functions can actually be removed as expected. Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--sphinx/util/__init__.py5
-rw-r--r--sphinx/util/osutil.py9
2 files changed, 12 insertions, 2 deletions
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