Skip to content

Commit 61f9b63

Browse files
authored
[Build] Add a nuclio suffix to the module name if function is being deployed from the file (#185)
1 parent d348a84 commit 61f9b63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nuclio/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ def build_file(filename='', name='', handler='', archive=False, project='',
8484
code = add_kind_footer(kind, config, code)
8585

8686
name = normalize_name(name or filebase)
87+
# Avoid import issues if the filename is the same as an existing Python library by adding a Nuclio suffix
88+
normalized_filebase = normalize_name(filebase) + '-nuclio'
8789
update_in(config, 'metadata.name', name)
8890
config = extend_config(config, spec, tag, filename)
89-
set_handler(config, normalize_name(filebase), '' if kind else handler, ext)
91+
set_handler(config, normalized_filebase, '' if kind else handler, ext)
9092

9193
log = logger.info if verbose else logger.debug
9294
log('Code:\n{}'.format(code))

0 commit comments

Comments
 (0)