An entry point is a file PragyaLint assumes gets run or imported from outside your codebase — the starting point for reachability analysis. Everything reachable from an entry point is "alive"; everything else is a candidate for deletion.
With no --entry flag, PragyaLint treats these as entries
automatically:
| Pattern | Why |
|---|---|
__main__.py | Runnable as a package (python -m yourpkg). |
main.py | Common script entry-point filename. |
app.py | Common web-app entry-point filename. |
cli.py | Common CLI entry-point filename. |
setup.py | Package build script, invoked by pip/setuptools directly. |
Root-level __init__.py | Package's public surface. |
Disable this with --no-conventional-entries if you want
to specify entries explicitly and nothing else.
Pass one or more entry points explicitly with --entry:
pragyalint --entry src/server.py --entry src/worker.py
pragyalint --entry src.server # module-name form also works
When --entry is given, it's used in addition to
test-file discovery (below) — not instead of it.
--entry.
Pytest (and unittest discovery) import conftest.py and
test_*.py/*_test.py files themselves, by
walking the filesystem — not through any import
statement in your source. A pure import-graph reachability check
would always see these as unreachable and try to delete your whole
test suite. PragyaLint recognizes this convention and treats matching
files as entries automatically.
Matched by any of:
conftest.pytest_ or ending in _test.pytests/, test/, or __tests__/ directory
Top-level definitions inside entry files (including test files)
aren't flagged by unused_local/unused_export
by default either — pytest calls test_foo functions by
name-convention, not by reference, so they'd otherwise show up as
"defined but never used" too. Pass --include-entry-exports
if you specifically want entry-file definitions checked anyway.
__init__.py files
Only the root __init__.py counts as a
conventional entry. Package __init__.py files deeper in
your tree are analyzed normally — if nothing imports that
subpackage, it's still flagged as unreachable.