Skip to content

Commit 23d7d8b

Browse files
committed
Bump weaver to 0.13.2
1 parent 7090f38 commit 23d7d8b

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

scripts/semconv/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ROOT_DIR="${SCRIPT_DIR}/../.."
77
# freeze the spec version to make SemanticAttributes generation reproducible
88
SEMCONV_VERSION=1.31.0
99
SEMCONV_VERSION_TAG=v$SEMCONV_VERSION
10-
OTEL_WEAVER_IMG_VERSION=v0.12.0
10+
OTEL_WEAVER_IMG_VERSION=v0.13.2
1111
INCUBATING_DIR=_incubating
1212
cd ${SCRIPT_DIR}
1313

scripts/semconv/templates/registry/common.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@
3232
from deprecated import deprecated
3333
{%- endif -%}
3434
{%- endmacro-%}
35+
36+
{%- macro deprecated_note_or_empty(attribute) -%}
37+
{% if attribute is deprecated %}{{ attribute.deprecated.note }}{% else %}{{""}}{% endif %}
38+
{%- endmacro %}

scripts/semconv/templates/registry/semantic_attributes.j2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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 %}

scripts/semconv/templates/registry/semantic_metrics.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
{%- macro write_docstring(metric, const_name, prefix) -%}
2525
{%- if metric is deprecated %}
26-
{{prefix}}Deprecated: {{c.comment_with_prefix(metric.deprecated, prefix)}}.
26+
{{prefix}}Deprecated: {{c.comment_with_prefix(metric.deprecated.note, prefix)}}.
2727
{%- elif ctx.filter == "any" and metric.stability == "stable" %}
2828
{{prefix}}Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`.
2929
{%- else -%}

0 commit comments

Comments
 (0)