class documentation

class FakeFSCache(FileSystemCache): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method init​_under​_package​_root Is this path an __init__.py under a package root?
Method isdir Undocumented
Method isfile Undocumented
Method listdir Undocumented
Instance Variable files Undocumented

Inherited from FileSystemCache:

Method exists Undocumented
Method exists​_case Return whether path exists - checking path components in case sensitive fashion, up to prefix.
Method flush Start another transaction and empty all caches.
Method hash​_digest Undocumented
Method isfile​_case Return whether path exists and is a file.
Method read Undocumented
Method samefile Undocumented
Method set​_package​_root Undocumented
Method stat Undocumented
Instance Variable exists​_case​_cache Undocumented
Instance Variable fake​_package​_cache Undocumented
Instance Variable hash​_cache Undocumented
Instance Variable isfile​_case​_cache Undocumented
Instance Variable listdir​_cache Undocumented
Instance Variable listdir​_error​_cache Undocumented
Instance Variable package​_root Undocumented
Instance Variable read​_cache Undocumented
Instance Variable read​_error​_cache Undocumented
Instance Variable stat​_cache Undocumented
Instance Variable stat​_error​_cache Undocumented
Method _fake​_init Prime the cache with a fake __init__.py file.
def __init__(self, files): (source)

Undocumented

Parameters
files:Set[str]Undocumented
def init_under_package_root(self, file): (source)

Is this path an __init__.py under a package root?

This is used to detect packages that don't contain __init__.py files, which is needed to support Bazel. The function should only be called for non-existing files.

It will return True if it refers to a __init__.py file that Bazel would create, so that at runtime Python would think the directory containing it is a package. For this to work you must pass one or more package roots using the --package-root flag.

As an exceptional case, any directory that is a package root itself will not be considered to contain a __init__.py file. This is different from the rules Bazel itself applies, but is necessary for mypy to properly distinguish packages from other directories.

See https://docs.bazel.build/versions/master/be/python.html, where this behavior is described under legacy_create_init.

Parameters
file:strUndocumented
Returns
boolUndocumented
def isdir(self, dir): (source)

Undocumented

Parameters
dir:strUndocumented
Returns
boolUndocumented
def isfile(self, file): (source)

Undocumented

Parameters
file:strUndocumented
Returns
boolUndocumented
def listdir(self, dir): (source)

Undocumented

Parameters
dir:strUndocumented
Returns
List[str]Undocumented
files = (source)

Undocumented