Exclude the directory from various archives and backups supporting CACHEDIR.TAG. If the CACHEDIR.TAG file exists the function is a no-op.
(target_dir: str)
| 1895 | |
| 1896 | |
| 1897 | def exclude_from_backups(target_dir: str) -> None: |
| 1898 | """Exclude the directory from various archives and backups supporting CACHEDIR.TAG. |
| 1899 | |
| 1900 | If the CACHEDIR.TAG file exists the function is a no-op. |
| 1901 | """ |
| 1902 | cachedir_tag = os_path_join(target_dir, "CACHEDIR.TAG") |
| 1903 | try: |
| 1904 | with open(cachedir_tag, "x") as f: |
| 1905 | f.write("""Signature: 8a477f597d28d172789f06886806bc55 |
| 1906 | # This file is a cache directory tag automatically created by mypy. |
| 1907 | # For information about cache directory tags see https://bford.info/cachedir/ |
| 1908 | """) |
| 1909 | except FileExistsError: |
| 1910 | pass |
| 1911 | |
| 1912 | |
| 1913 | def create_metastore(options: Options, parallel_worker: bool) -> MetadataStore: |
no test coverage detected
searching dependent graphs…