class FakeFSCache(FileSystemCache): (source)
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. |
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:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.fscache.FileSystemCache.isdir
Undocumented
Parameters | |
dir:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.fscache.FileSystemCache.isfile
Undocumented
Parameters | |
file:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.fscache.FileSystemCache.listdir
Undocumented
Parameters | |
dir:str | Undocumented |
Returns | |
List[ | Undocumented |