Manual
Files & Imports
- Directory scanning: When a directory is passed to
tanny check, tanny recursively collects all *.py files in lexicographical order, skipping hidden entries (names starting with .) and __pycache__.
- Which models run: Only
Model(...) declarations in the explicitly passed files/directories are checked. Modules loaded transitively through from ... import ... supply referenced @spec classes, helper functions, type aliases, and ModelValue sorts, without executing models defined in those imported files.
- Import search order:
- Relative imports (
from .foo import Bar, from ..pkg import Baz) resolve relative to the importing file's directory.
- Absolute
from pkg.mod import Name imports search each --root directory in order, followed by the importing file's package root (the nearest ancestor directory outside any __init__.py package hierarchy). Both pkg/mod.py and pkg/mod/__init__.py are checked.
- No execution: User code is never imported by Python or executed; all declarations are extracted statically from the syntax tree.