Get locations to search for YAML configuration files. This logic exists as a separate function for testing purposes.
()
| 19 | |
| 20 | |
| 21 | def _get_paths(): |
| 22 | """Get locations to search for YAML configuration files. |
| 23 | |
| 24 | This logic exists as a separate function for testing purposes. |
| 25 | """ |
| 26 | |
| 27 | paths = [ |
| 28 | os.getenv("DASK_ROOT_CONFIG", "/etc/dask"), |
| 29 | os.path.join(sys.prefix, "etc", "dask"), |
| 30 | *[os.path.join(prefix, "etc", "dask") for prefix in site.PREFIXES], |
| 31 | os.path.join(os.path.expanduser("~"), ".config", "dask"), |
| 32 | ] |
| 33 | if "DASK_CONFIG" in os.environ: |
| 34 | paths.append(os.environ["DASK_CONFIG"]) |
| 35 | |
| 36 | # Remove duplicate paths while preserving ordering |
| 37 | paths = list(reversed(list(dict.fromkeys(reversed(paths))))) |
| 38 | |
| 39 | return paths |
| 40 | |
| 41 | |
| 42 | paths = _get_paths() |
searching dependent graphs…