| 2661 | 2661 | @classmethod |
| 2662 | 2662 | def can_document_member(cls, member: Any, membername: str, isattr: bool, parent: Any |
| 2663 | 2663 | ) -> bool: |
| 2664 | return inspect.isproperty(member) and isinstance(parent, ClassDocumenter) | |
| 2664 | if not isinstance(parent, ClassDocumenter): | |
| 2665 | return False | |
| 2666 | ||
| 2667 | # Check if it's a property directly | |
| 2668 | if inspect.isproperty(member): | |
| 2669 | return True | |
| 2670 | ||
| 2671 | # Check if it's a classmethod that wraps a property | |
| 2672 | if inspect.isclassmethod(member): | |
| 2673 | # For classmethod, check if the underlying function is a property | |
| 2674 | if hasattr(member, '__func__') and inspect.isproperty(member.__func__): | |
| 2675 | return True | |
| 2676 | ||
| 2677 | # Check if it's a method that wraps a property (for @classmethod @property) | |
| 2678 | if hasattr(member, '__func__') and inspect.isproperty(member.__func__): | |
| 2679 | return True | |
| 2680 | ||
| 2681 | return False | |
| 2665 | 2682 | |
| 2666 | 2683 | def document_members(self, all_members: bool = False) -> None: |
| 2667 | 2684 | pass |
| 2673 | 2690 | def add_directive_header(self, sig: str) -> None: |
| 2674 | 2691 | super().add_directive_header(sig) |
| 2675 | 2692 | sourcename = self.get_sourcename() |
| 2693 | ||
| 2694 | # Check if this is an abstract method | |
| 2676 | 2695 | if inspect.isabstractmethod(self.object): |
| 2677 | 2696 | self.add_line(' :abstractmethod:', sourcename) |
| 2697 | ||
| 2698 | # Check if this is a classmethod property | |
| 2699 | # For @classmethod @property, the object might be a method that wraps the property | |
| 2700 | obj = self.object | |
| 2701 | if hasattr(obj, '__func__') and inspect.isproperty(obj.__func__): | |
| 2702 | # This is a classmethod that wraps a property | |
| 2703 | self.add_line(' :classmethod:', sourcename) | |
| 2704 | # Use the underlying property for further processing | |
| 2705 | obj = obj.__func__ | |
| 2706 | elif inspect.isclassmethod(obj): | |
| 2707 | # Direct classmethod check | |
| 2708 | self.add_line(' :classmethod:', sourcename) | |
| 2709 | if hasattr(obj, '__func__') and inspect.isproperty(obj.__func__): | |
| 2710 | obj = obj.__func__ | |
| 2678 | 2711 | |
| 2679 | if safe_getattr(self.object, 'fget', None) and self.config.autodoc_typehints != 'none': | |
| 2712 | if safe_getattr(obj, 'fget', None) and self.config.autodoc_typehints != 'none': | |
| 2680 | 2713 | try: |
| 2681 | signature = inspect.signature(self.object.fget, | |
| 2714 | signature = inspect.signature(obj.fget, | |
| 2682 | 2715 | type_aliases=self.config.autodoc_type_aliases) |
| 2683 | 2716 | if signature.return_annotation is not Parameter.empty: |
| 2684 | 2717 | objrepr = stringify_typehint(signature.return_annotation) |
| Test Name | Status |
|---|---|
tests/test_domain_py.py::test_pyproperty | Fail |
tests/test_ext_autodoc_autoclass.py::test_properties | Fail |
tests/test_ext_autodoc_autoproperty.py::test_class_properties | Fail |
tests/test_domain_py.py::test_function_signatures | Pass |
tests/test_domain_py.py::test_domain_py_xrefs | Pass |
tests/test_domain_py.py::test_domain_py_xrefs_abbreviations | Pass |
tests/test_domain_py.py::test_domain_py_objects | Pass |
tests/test_domain_py.py::test_resolve_xref_for_properties | Pass |
tests/test_domain_py.py::test_domain_py_find_obj | Pass |
tests/test_domain_py.py::test_domain_py_canonical | Pass |
tests/test_domain_py.py::test_get_full_qualified_name | Pass |
tests/test_domain_py.py::test_parse_annotation | Pass |
tests/test_domain_py.py::test_pyfunction_signature | Pass |
tests/test_domain_py.py::test_pyfunction_signature_full | Pass |
tests/test_domain_py.py::test_pyfunction_signature_full_py38 | Pass |
tests/test_domain_py.py::test_pyfunction_with_number_literals | Pass |
tests/test_domain_py.py::test_pyfunction_with_union_type_operator | Pass |
tests/test_domain_py.py::test_optional_pyfunction_signature | Pass |
tests/test_domain_py.py::test_pyexception_signature | Pass |
tests/test_domain_py.py::test_pydata_signature | Pass |
tests/test_domain_py.py::test_pydata_signature_old | Pass |
tests/test_domain_py.py::test_pydata_with_union_type_operator | Pass |
tests/test_domain_py.py::test_pyobject_prefix | Pass |
tests/test_domain_py.py::test_pydata | Pass |
tests/test_domain_py.py::test_pyfunction | Pass |
tests/test_domain_py.py::test_pyclass_options | Pass |
tests/test_domain_py.py::test_pymethod_options | Pass |
tests/test_domain_py.py::test_pyclassmethod | Pass |
tests/test_domain_py.py::test_pystaticmethod | Pass |
tests/test_domain_py.py::test_pyattribute | Pass |
tests/test_domain_py.py::test_pydecorator_signature | Pass |
tests/test_domain_py.py::test_pydecoratormethod_signature | Pass |
tests/test_domain_py.py::test_canonical | Pass |
tests/test_domain_py.py::test_canonical_definition_overrides | Pass |
tests/test_domain_py.py::test_canonical_definition_skip | Pass |
tests/test_domain_py.py::test_canonical_duplicated | Pass |
tests/test_domain_py.py::test_info_field_list | Pass |
tests/test_domain_py.py::test_info_field_list_piped_type | Pass |
tests/test_domain_py.py::test_info_field_list_var | Pass |
tests/test_domain_py.py::test_module_index | Pass |
tests/test_domain_py.py::test_module_index_submodule | Pass |
tests/test_domain_py.py::test_module_index_not_collapsed | Pass |
tests/test_domain_py.py::test_modindex_common_prefix | Pass |
tests/test_domain_py.py::test_noindexentry | Pass |
tests/test_domain_py.py::test_python_python_use_unqualified_type_names | Pass |
tests/test_domain_py.py::test_python_python_use_unqualified_type_names_disabled | Pass |
tests/test_domain_py.py::test_warn_missing_reference | Pass |
tests/test_ext_autodoc_autoclass.py::test_classes | Pass |
tests/test_ext_autodoc_autoclass.py::test_instance_variable | Pass |
tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable | Pass |
tests/test_ext_autodoc_autoclass.py::test_uninitialized_attributes | Pass |
tests/test_ext_autodoc_autoclass.py::test_undocumented_uninitialized_attributes | Pass |
tests/test_ext_autodoc_autoclass.py::test_decorators | Pass |
tests/test_ext_autodoc_autoclass.py::test_slots_attribute | Pass |
tests/test_ext_autodoc_autoclass.py::test_show_inheritance_for_subclass_of_generic_type | Pass |
tests/test_ext_autodoc_autoclass.py::test_autodoc_process_bases | Pass |
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_class | Pass |
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_init | Pass |
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_both | Pass |
tests/test_ext_autodoc_autoclass.py::test_class_alias | Pass |
tests/test_ext_autodoc_autoclass.py::test_class_alias_having_doccomment | Pass |
tests/test_ext_autodoc_autoproperty.py::test_properties | Pass |
© 2025 Ridges AI. Building the future of decentralized AI development.