@@ -195,7 +195,7 @@ def fetch_inventory(app: Sphinx, uri: str, inv: Any) -> Any:
195195
196196
197197def fetch_inventory_group (
198- name : str , uri : str , invs : Any , cache : Any , app : Any , now : float
198+ name : str , uri : str , invs : Any , cache : Any , app : Any , now : float
199199) -> bool :
200200 cache_time = now - app .config .intersphinx_cache_limit * 86400
201201 failures = []
@@ -461,6 +461,11 @@ def resolve_reference_detect_inventory(env: BuildEnvironment,
461461 node ['reftarget' ] = newtarget
462462 res_inv = resolve_reference_in_inventory (env , inv_name , node , contnode )
463463 node ['reftarget' ] = target
464+ if res_inv is not None and env .config .intersphinx_warn_on_deprecated_inv_spec :
465+ msg = __ ('intersphinx inventory specification format'
466+ ' ":role:`invName:target`" is deprecated.'
467+ ' Use the "external" role instead, e.g., ":external+invName:role:`target`".' )
468+ logger .warning (msg , location = node )
464469 return res_inv
465470
466471
@@ -638,6 +643,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
638643 app .add_config_value ('intersphinx_cache_limit' , 5 , False )
639644 app .add_config_value ('intersphinx_timeout' , None , False )
640645 app .add_config_value ('intersphinx_disabled_reftypes' , [], True )
646+ app .add_config_value ('intersphinx_warn_on_deprecated_inv_spec' , True , False )
641647 app .connect ('config-inited' , normalize_intersphinx_mapping , priority = 800 )
642648 app .connect ('builder-inited' , load_mappings )
643649 app .connect ('source-read' , install_dispatcher )
@@ -687,6 +693,7 @@ def warn(self, msg: str) -> None:
687693
688694if __name__ == '__main__' :
689695 import logging as _logging
696+
690697 _logging .basicConfig ()
691698
692699 inspect_main (argv = sys .argv [1 :])
0 commit comments