Exclude files/folders in workdir using Runtime Environments


is it possible to tell the runtime Environment, when defining the environment to exclude files or folders?

runtime_env = {
    'working_dir': '.',
    'pip':  "./requirements.txt",

I am thinking of something similar like setup.py does with the exclude possibility or something like .gitignore or .dockerignore.

We have our code in a way that we have test alongside our data, also we have test data in the there, having the possibility to exclude files based on regex would save additional effort porting the code to another location before using the runtime.

Hi @TanjaBayer, yes, in the runtime env dict you can use the option "excludes" : ["my_file", "my_dir"] with a list of files and/or directories to exclude. You can also include git wildmatch patterns in this list (we use pathspec · PyPI under the hood). Also, the .gitignore file in your working dir is automatically parsed and used to exclude files from the environment.

Thanks for bringing this up, it looks like this is not documented right now, I will add it–sorry for the oversight!

That is cool :+1: it is experimental, so not expecting everything is already 100% documented :wink: