You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surround will automatically try to determine the package_path by searching for the directory that contains config.yaml. However, if a second config.yaml file is found (e.g. in a subdirectory of input), this will cause package_path to be None, which can cause a previously working Surround project to suddenly stop working.
Expected behaviour
Surround should ignore the input directory completely when searching for a config.yaml
Surround should search top level directories before it searches subdirectories
Actual behaviour
Surround walks the entire project (including the input directory) in search of a config.yaml file, no matter how deeply nested (on projects with large input directories like MSR, this adds a 20 second delay every time Surround is run, even if just to list Surround tasks)
Surround filters out files directly in one of the generated directories specified by PROJECTS['new']['dirs'], e.g. input/config.yaml. However, input/subdir/config.yaml will still cause problems.
This can cause surround run to fail for Surround projects that try to utilise CONFIG["package_path"] in their dodo.py. Example for MSR Surround project:
Project tasks:
Traceback (most recent call last):
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/site-packages/doit/doit_cmd.py", line 177, in run
return command.parse_execute(args)
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/site-packages/doit/cmd_base.py", line 127, in parse_execute
return self.execute(params, args)
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/site-packages/doit/cmd_base.py", line 389, in execute
self, params, args)
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/site-packages/doit/cmd_base.py", line 281, in load_tasks
params['seek_file'])
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/site-packages/doit/loader.py", line 95, in get_module
return importlib.import_module(os.path.splitext(file_name)[0])
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/andrew/src/msr-research/mining-nlp-repositories/dodo.py", line 8, in <module>
PACKAGE_PATH = os.path.basename(CONFIG["package_path"])
File "/home/andrew/anaconda3/envs/msr/lib/python3.7/posixpath.py", line 146, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
results = [path for path, _, files in os.walk(project_root) if 'config.yaml' in files]
results = [path for path in results if os.path.basename(path) not in PROJECTS['new']['dirs']]
return results[0] if len(results) == 1 else None
The text was updated successfully, but these errors were encountered:
Surround will automatically try to determine the
package_path
by searching for the directory that containsconfig.yaml
. However, if a secondconfig.yaml
file is found (e.g. in a subdirectory ofinput
), this will causepackage_path
to beNone
, which can cause a previously working Surround project to suddenly stop working.Expected behaviour
input
directory completely when searching for aconfig.yaml
Actual behaviour
input
directory) in search of aconfig.yaml
file, no matter how deeply nested (on projects with large input directories like MSR, this adds a 20 second delay every time Surround is run, even if just to list Surround tasks)PROJECTS['new']['dirs']
, e.g.input/config.yaml
. However,input/subdir/config.yaml
will still cause problems.surround run
to fail for Surround projects that try to utiliseCONFIG["package_path"]
in theirdodo.py
. Example for MSR Surround project:Cause
https://github.com/a2i2/surround/blob/v0.0.13/surround/config.py#L199
The text was updated successfully, but these errors were encountered: