Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit a0c41b9

Browse files
[fix] Address bad import against nested messages. (#83)
This commit fixes a spurious import that tried to import nested messages directly from module scope.
1 parent 9277e9c commit a0c41b9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

gapic/templates/$namespace/$name_$version/types/$sub/__init__.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ from . import {{ subpackage }}
1313
-#}
1414
{% for proto in api.protos.values()|sort(attribute='module_name')
1515
if proto.meta.address.subpackage == api.subpackage_view -%}
16-
{% for message in proto.messages.values()|sort(attribute='name') -%}
16+
{% for message in proto.top.messages.values()|sort(attribute='name') -%}
1717
from .{{ proto.module_name }} import {{ message.name }}
1818
{% endfor %}{% endfor %}
1919

@@ -24,7 +24,7 @@ __all__ = (
2424
{%- endfor %}
2525
{%- for proto in api.protos.values()|sort(attribute='module_name')
2626
if proto.meta.address.subpackage == api.subpackage_view %}
27-
{%- for message in proto.messages.values()|sort(attribute='name') %}
27+
{%- for message in proto.top.messages.values()|sort(attribute='name') %}
2828
'{{ message.name }}',
2929
{%- endfor %}{% endfor %}
3030
)

setup.py

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

2626
setup(
2727
name='gapic-generator',
28-
version='0.3.0',
28+
version='0.3.1',
2929
license='Apache 2.0',
3030
author='Luke Sneeringer',
3131
author_email='lukesneeringer@google.com',

0 commit comments

Comments
 (0)