From 399c7f8a042bcc9b92b7e42c83f88ddfd05020e8 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 22 Aug 2023 10:26:43 -0400 Subject: [PATCH] fix(extensions): ensure __init__.py in extension dir is present `gen_proto.sh` was deleting this file (or not recreating it) and if it isn't present, then it isn't possible to grab the extension yaml files in Python using `importlib.resources.files`. This restores the missing __init__.py file and also adds a `touch` to the `gen_proto.sh` script to make sure it sticks around. --- gen_proto.sh | 3 +++ src/substrait/extensions/__init__.py | 0 2 files changed, 3 insertions(+) create mode 100644 src/substrait/extensions/__init__.py diff --git a/gen_proto.sh b/gen_proto.sh index 04939b1..5f47f7f 100755 --- a/gen_proto.sh +++ b/gen_proto.sh @@ -27,5 +27,8 @@ rm -rf "$extension_dir" cp -fr "$submodule_dir"/extensions "$extension_dir" find "$extension_dir" -type f -exec chmod u+rw {} + +# Ensure there's an __init__.py file in the extension directory +touch $extension_dir/__init__.py + # Remove the temporary work dir rm -rf "$tmp_dir" diff --git a/src/substrait/extensions/__init__.py b/src/substrait/extensions/__init__.py new file mode 100644 index 0000000..e69de29