mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Un-deprecate `sphinx.util.import_object
` (#13330)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
9069005087
commit
94563a398b
@ -27,6 +27,8 @@ Deprecated
|
||||
|
||||
* #13037: Deprecate the ``SingleHTMLBuilder.fix_refuris`` method.
|
||||
Patch by James Addison.
|
||||
* #13083, #13330: Un-deprecate ``sphinx.util.import_object``.
|
||||
Patch by Matthias Geier.
|
||||
|
||||
Features added
|
||||
--------------
|
||||
|
@ -37,11 +37,6 @@ The following is a list of deprecated interfaces.
|
||||
- 10.0
|
||||
- N/A
|
||||
|
||||
* - ``sphinx.util.import_object``
|
||||
- 8.1
|
||||
- 10.0
|
||||
- ``importlib.import_module``
|
||||
|
||||
* - ``sphinx.ext.intersphinx.normalize_intersphinx_mapping``
|
||||
- 8.0
|
||||
- 10.0
|
||||
|
@ -98,12 +98,6 @@ def __getattr__(name: str) -> Any:
|
||||
_deprecation_warning(__name__, name, '', remove=(10, 0))
|
||||
return obj
|
||||
|
||||
if name == 'import_object':
|
||||
from sphinx.util._importer import import_object
|
||||
|
||||
_deprecation_warning(__name__, name, '', remove=(10, 0))
|
||||
return import_object
|
||||
|
||||
# Re-exported for backwards compatibility,
|
||||
# but not currently deprecated
|
||||
|
||||
@ -112,6 +106,11 @@ def __getattr__(name: str) -> Any:
|
||||
|
||||
return encode_uri
|
||||
|
||||
if name == 'import_object':
|
||||
from sphinx.util._importer import import_object
|
||||
|
||||
return import_object
|
||||
|
||||
if name == 'isurl':
|
||||
from sphinx.util._uri import is_url
|
||||
|
||||
|
@ -69,12 +69,11 @@ def test_exported_attributes():
|
||||
assert sphinx.util.FilenameUniqDict is FilenameUniqDict
|
||||
with pytest.warns(RemovedInSphinx10Warning, match=r'deprecated.'):
|
||||
assert sphinx.util.DownloadFiles is DownloadFiles
|
||||
with pytest.warns(RemovedInSphinx10Warning, match=r'deprecated.'):
|
||||
assert sphinx.util.import_object is import_object
|
||||
|
||||
# Re-exported for backwards compatibility,
|
||||
# but not currently deprecated
|
||||
assert sphinx.util.encode_uri is encode_uri
|
||||
assert sphinx.util.import_object is import_object
|
||||
assert sphinx.util.isurl is is_url
|
||||
assert sphinx.util.parselinenos is parse_line_num_spec
|
||||
assert sphinx.util.patfilter is patfilter
|
||||
|
Loading…
Reference in New Issue
Block a user