Skip to content

Commit

Permalink
Deprecate sphinx.util.path_stabilize
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jun 3, 2022
1 parent a0755be commit 71835c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

* - ``sphinx.util.path_stabilize``
- 5.1
- 7.0
- ``sphinx.util.osutil.path_stabilize``

* - ``sphinx.util.get_matching_files``
- 5.1
- 7.0
Expand Down
12 changes: 11 additions & 1 deletion sphinx/util/__init__.py
Expand Up @@ -28,7 +28,7 @@
# import other utilities; partly for backwards compatibility, so don't
# prune unused ones indiscriminately
from sphinx.util.osutil import (SEP, copyfile, copytimes, ensuredir, make_filename, # noqa
mtimes_of_files, os_path, path_stabilize, relative_uri)
mtimes_of_files, os_path, relative_uri)
from sphinx.util.typing import PathMatcher

if TYPE_CHECKING:
Expand All @@ -49,6 +49,16 @@ def docname_join(basedocname: str, docname: str) -> str:
posixpath.join('/' + basedocname, '..', docname))[1:]


def path_stabilize(filepath: str) -> str:
"Normalize path separator and unicode string"
warnings.warn("'sphinx.util.path_stabilize' is deprecated, use "
"'sphinx.util.osutil.path_stabilize' instead.",
RemovedInSphinx70Warning, stacklevel=2)
from sphinx.util import osutil

return osutil.path_stabilize(filepath)


def get_matching_files(dirname: str,
exclude_matchers: Tuple[PathMatcher, ...] = (),
include_matchers: Tuple[PathMatcher, ...] = ()) -> Iterable[str]: # NOQA
Expand Down

0 comments on commit 71835c2

Please sign in to comment.