class FileSystemCache: (source)
Known subclasses: mypy.test.test_find_sources.FakeFSCache
Undocumented
Method | __init__ |
Undocumented |
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 | init_under_package_root |
Is this path an __init__.py under a package root? |
Method | isdir |
Undocumented |
Method | isfile |
Undocumented |
Method | isfile_case |
Return whether path exists and is a file. |
Method | listdir |
Undocumented |
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. |
Parameters | |
path:str | Undocumented |
prefix:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.test.test_find_sources.FakeFSCache
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 | |
path:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.test.test_find_sources.FakeFSCache
Undocumented
Parameters | |
path:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.test.test_find_sources.FakeFSCache
Undocumented
Parameters | |
path:str | Undocumented |
Returns | |
bool | Undocumented |
Return whether path exists and is a file.
On case-insensitive filesystems (like Mac or Windows) this returns False if the case of path's last component does not exactly match the case found in the filesystem.
We check also the case of other path components up to prefix. For example, if path is 'user-stubs/pack/mod.pyi' and prefix is 'user-stubs', we check that the case of 'pack' and 'mod.py' matches exactly, 'user-stubs' will be case insensitive on case insensitive filesystems.
The caller must ensure that prefix is a valid file system prefix of path.
Parameters | |
path:str | Undocumented |
prefix:str | Undocumented |
Returns | |
bool | Undocumented |
mypy.test.test_find_sources.FakeFSCache
Undocumented
Parameters | |
path:str | Undocumented |
Returns | |
List[ | Undocumented |