diff --git a/crates/re_types_builder/src/codegen/python.rs b/crates/re_types_builder/src/codegen/python.rs index 2251ff6a4935..6df277f35a0f 100644 --- a/crates/re_types_builder/src/codegen/python.rs +++ b/crates/re_types_builder/src/codegen/python.rs @@ -411,15 +411,17 @@ impl PythonCodeGenerator { code.push_text(&clause, 1, 0); } - code.push_unindented_text( - format!( - " + if !manifest.is_empty() { + code.push_unindented_text( + format!( + " __all__ = [{manifest}] ", - ), - 0, - ); + ), + 0, + ); + } let obj_code = if obj.is_struct() { code_for_struct(reporter, arrow_registry, &ext_class, objects, obj) @@ -508,7 +510,9 @@ fn write_init_file( let names = names.join(", "); code.push_text(&format!("from .{module} import {names}"), 1, 0); } - code.push_unindented_text(format!("\n__all__ = [{manifest}]"), 0); + if !manifest.is_empty() { + code.push_unindented_text(format!("\n__all__ = [{manifest}]"), 0); + } files_to_write.insert(path, code); } diff --git a/rerun_py/tests/test_types/blueprint/__init__.py b/rerun_py/tests/test_types/blueprint/__init__.py index 800eca1d45a1..b848838d60eb 100644 --- a/rerun_py/tests/test_types/blueprint/__init__.py +++ b/rerun_py/tests/test_types/blueprint/__init__.py @@ -1,5 +1,3 @@ # DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/python.rs from __future__ import annotations - -__all__ = []