MCPcopy
hub / github.com/python/mypy / exclude_from_backups

Function exclude_from_backups

mypy/build.py:1897–1910  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1895
1896
1897def 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
1913def create_metastore(options: Options, parallel_worker: bool) -> MetadataStore:

Callers 1

build_innerFunction · 0.85

Calls 2

os_path_joinFunction · 0.90
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…