@@ -31,11 +31,11 @@ from typing import Final
3131{{ctx.stable_package_name}}.{{ctx.root_namespace}}_attributes{{separator}}{{const_name}}
3232{% - endmacro %}
3333
34- {% - macro write_docstring (name , brief , note , deprecated , stability , multiline ) -%}
34+ {% - macro write_docstring (name , brief , note , deprecated_note , stability , multiline ) -%}
3535{% - if multiline %} """
3636{% endif %}
37- {% - if c .str_or_empty (deprecated )|length -%}
38- {{prefix}}Deprecated: {{c.comment_with_prefix(deprecated , "")}}.
37+ {% - if c .str_or_empty (deprecated_note )|length -%}
38+ {{prefix}}Deprecated: {{c.comment_with_prefix(deprecated_note , "")}}.
3939 {% - elif ctx .filter == "any" and stability == "stable" -%}
4040{{prefix}}Deprecated in favor of stable :py:const:`{{stable_class_ref(name, '.')}}`.
4141 {% - elif c .str_or_empty (brief )|length -%}
@@ -51,15 +51,16 @@ from typing import Final
5151{% for attribute in attributes %}
5252{% set attr_name = attribute_name (attribute ) %}
5353{% - set multiline = attribute .name not in ctx .excluded_attributes -%}
54- {% - set doc_string = write_docstring (attr_name , attribute .brief , attribute .note , attribute .deprecated , attribute .stability , multiline )-%}
54+ {% - set deprecated_note = c .deprecated_note_or_empty (attribute ) %}
55+ {% - set doc_string = write_docstring (attr_name , attribute .brief , attribute .note , deprecated_note , attribute .stability , multiline )-%}
5556{% - set prefix = "" if multiline else "# " -%}
5657{{prefix}}{{attr_name}}: Final = "{{attribute.name}}"
5758{{prefix}}{{doc_string}}
5859{% endfor %}
5960
6061{% for attribute in enum_attributes %}{% - set class_name = attribute .name | pascal_case ~ "Values" -%}
6162{% - if attribute is deprecated %}
62- @deprecated(reason="The attribute {{attribute.name}} is deprecated - {{ c.comment_with_prefix(attribute.deprecated, "") }}") # type: ignore
63+ @deprecated(reason="The attribute {{attribute.name}} is deprecated - {{ c.comment_with_prefix(attribute.deprecated.note , "") }}") # type: ignore
6364 {% - elif attribute .stability == "stable" and ctx .filter == "any" %}
6465@deprecated(reason="Deprecated in favor of stable :py:const:`{{stable_class_ref(class_name, '.')}}`.") # type: ignore
6566 {% - endif %}
0 commit comments