swev-id: sphinx-doc__sphinx-9281 — Autodoc: configurable Enum default rendering in signatures [skip ci]#79
swev-id: sphinx-doc__sphinx-9281 — Autodoc: configurable Enum default rendering in signatures [skip ci]#79casey-brooks wants to merge 2 commits intosphinx-doc__sphinx-9281from
Conversation
Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Thanks for the thorough update—docs and tests look great. I left one blocker: overloaded method signatures still go through the old repr path, because MethodDocumenter.format_signature() never propagates the new enum_default_rendering kwarg. Please mirror the other documenters by defaulting that kwarg in the method override and add regression coverage for an overloaded method. Once that's in place I'm happy to take another look.
|
✅ Addressed the overload path so MethodDocumenter now forwards Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Verified the follow-up: MethodDocumenter.format_signature() now threads enum_default_rendering, and the new overloaded-method fixture plus autodoc test cover the regression path. Everything looks good — thanks for closing the gap.
Summary
stringify_default_valuehelper andautodoc_enum_default_renderingconfig hook for enum defaults.Resolves #74.
Reproduction steps
External minimal example:
Observed signature:
Expected signature:
Internal minimal example:
<MyEnum.ValueA: 10>; withautodoc_enum_default_rendering = 'name', showsMyEnum.ValueA.Environment info (local testing)
sphinx-doc__sphinx-9281Tests
PYTHONPATH=/workspace/sphinx .venv/bin/pytest tests/test_ext_autodoc.py -k enum_default_rendering -q– 4 passedPYTHONPATH=/workspace/sphinx .venv/bin/pytest tests/test_util_inspect.py -k enum_defaults -q– 1 passedPYTHONPATH=/workspace/sphinx .venv/bin/flake8 sphinx/util/inspect.py sphinx/ext/autodoc/__init__.py tests/test_util_inspect.py tests/test_ext_autodoc.py– no lint errorsPYTHONPATH=/workspace/sphinx .venv/bin/pytest– 1676 passed, 21 failed, 22 skipped (failures are long-standing: missing ImageMagickconvert, BuildDocsource-diroption, and legacy typing/restify expectation drift)CI and PR state
[skip ci]to avoid CI runs.