Using a custom python function in a r package

Hi,

I am working on implementing a new feature for my refinitiv package and I want to use a custom python function. However I don't want to create a global variable in my r package as the cran check does not like this.

reticulate::import_from_path( module = "refinitiv_utils.py"
                            ,  path = system.file("python/refinitiv_utils.py", package = "Refinitiv")
                            ,  delay_load = F, convert = F
                            )

fails with the following warning:

Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'refinitiv_utils'

however if I execute:

split_tupple_list <<- reticulate::source_python(system.file("python/refinitiv_utils.py"
                                                           , package = "Refinitiv"))

the function works without any issues.

the contents of the function refinitiv_utils.py:

def split_tupple_list(x):
  return_list = [item[0] for item in x]
  return return_list

Any advice pls?