363363
364364def autodoc_skip_member_handler (app , what , name , obj , skip , options ):
365365 """
366- Skips the RSASigner and RSAVerifier from the internal _cryptography_rsa module
367- if they are being documented under that internal module path ,
368- as they are publicly exposed via google.auth.crypt .
366+ Skips members from internal modules (like _cryptography_rsa or base)
367+ if they are publicly exposed via a higher-level package (like google.auth.crypt) ,
368+ to avoid duplicate documentation entries and ambiguous cross-references .
369369 """
370+ # Handle RSASigner and RSAVerifier from _cryptography_rsa
370371 if name in ("RSASigner" , "RSAVerifier" ) and hasattr (obj , "__module__" ):
371372 if obj .__module__ == "google.auth.crypt._cryptography_rsa" :
372373 # Check if it's also available via the public google.auth.crypt path
@@ -378,6 +379,18 @@ def autodoc_skip_member_handler(app, what, name, obj, skip, options):
378379 return True # Skip this internal one
379380 except ImportError :
380381 pass # Should not happen if the library is installed
382+
383+ # Handle Signer and Verifier from base
384+ elif name in ("Signer" , "Verifier" ) and hasattr (obj , "__module__" ):
385+ if obj .__module__ == "google.auth.crypt.base" :
386+ # Check if it's also available via the public google.auth.crypt path
387+ try :
388+ import google .auth .crypt
389+ public_obj = getattr (google .auth .crypt , name , None )
390+ if public_obj is obj :
391+ return True # Skip this internal one
392+ except ImportError :
393+ pass # Should not happen if the library is installed
381394 return None # Default behavior (don't skip)
382395
383396
0 commit comments