|
358 | 358 | # texinfo_no_detailmenu = False |
359 | 359 |
|
360 | 360 |
|
361 | | -# -- Options for autodoc -------------------------------------------------- |
362 | | - |
363 | | - |
364 | | -def autodoc_skip_member_handler(app, what, name, obj, skip, options): |
365 | | - """ |
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. |
369 | | - """ |
370 | | - # Handle RSASigner and RSAVerifier from _cryptography_rsa |
371 | | - if name in ("RSASigner", "RSAVerifier") and hasattr(obj, "__module__"): |
372 | | - if obj.__module__ == "google.auth.crypt._cryptography_rsa": |
373 | | - # Check if it's also available via the public google.auth.crypt path |
374 | | - try: |
375 | | - import google.auth.crypt |
376 | | - |
377 | | - public_obj = getattr(google.auth.crypt, name, None) |
378 | | - if public_obj is obj: |
379 | | - return True # Skip this internal one |
380 | | - except ImportError: |
381 | | - 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 | | - |
390 | | - public_obj = getattr(google.auth.crypt, name, None) |
391 | | - if public_obj is obj: |
392 | | - return True # Skip this internal one |
393 | | - except ImportError: |
394 | | - pass # Should not happen if the library is installed |
395 | | - return None # Default behavior (don't skip) |
396 | | - |
397 | | - |
398 | | -def setup(app): |
399 | | - app.connect("autodoc-skip-member", autodoc_skip_member_handler) |
400 | | - |
401 | | - |
402 | 361 | # Example configuration for intersphinx: refer to the Python standard library. |
403 | 362 | intersphinx_mapping = { |
404 | 363 | "python": ("https://docs.python.org/3.5", None), |
|
0 commit comments