From 763867bdc6f48771a945fe9be3d07a2b7b95d187 Mon Sep 17 00:00:00 2001 From: rokatyy Date: Sun, 14 Jul 2024 09:26:13 +0100 Subject: [PATCH] Add a nuclio suffix to the module name if function is being deployed from the file --- nuclio/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nuclio/build.py b/nuclio/build.py index c58517d..7672f08 100644 --- a/nuclio/build.py +++ b/nuclio/build.py @@ -84,6 +84,8 @@ def build_file(filename='', name='', handler='', archive=False, project='', code = add_kind_footer(kind, config, code) name = normalize_name(name or filebase) + # Avoid import issues if the filename is the same as an existing Python library by adding a Nuclio suffix + normalized_filebase = normalize_name(filebase) + '-nuclio' update_in(config, 'metadata.name', name) config = extend_config(config, spec, tag, filename) set_handler(config, normalize_name(filebase), '' if kind else handler, ext)