Determine exactly which files are necessary to run a Python application
by jaredpalmerTypeScript
Last 12 weeks ยท 13 commits
2 of 6 standards met
This adds static analysis support for runpy module functions: runpy.run_module('module') - traces module imports runpy.run_path('path.py') - traces file path imports Supports aliased imports (import runpy as rp) Supports direct imports (from runpy import run_module) Handles keyword arguments (mod_name=, path_name=) Reports non-static expressions as warnings Implementation includes: Python AST parser updates in parse_imports.py TypeScript regex fallback parser updates trace.ts updates to resolve run_path file paths DynamicImportInfo type extended with 'runpy' type and 'path' field README updated to document runpy as handled Comprehensive tests and fixtures for all variants
Repository: jaredpalmer/python-file-trace. Description: Determine exactly which files are necessary to run a Python application Stars: 9, Forks: 0. Primary language: TypeScript. Languages: TypeScript (83.2%), Python (16.8%). License: MIT. Open PRs: 0, open issues: 0. Last activity: 2mo ago. Community health: 42%. Top contributors: jaredpalmer, Copilot.
Add table of contents after Quick Start for easier navigation Reorganize sections in logical order: Features โ Examples โ API โ How It Works Consolidate all API documentation into single "API Reference" section Move "Usage" example into Examples section as "Basic Usage" Add visual separators between API functions for better readability Remove redundant "Additional APIs" section by integrating into main API Reference
Document all Python import patterns handled by the tracer and those that remain unsupported. The table covers: Handled: Static imports (standard, dotted, aliased, from, relative, star) Multi-line imports (parentheses and backslash continuation) Dynamic imports (__import__, importlib variants, aliased forms) Contextual imports (try/except, conditional, function-level) Package handling (init files, submodules, namespace packages) False positive prevention (strings, docstrings, comments) Not Yet Handled: Dynamic/runtime patterns (computed names, exec/eval, runpy) Lazy loading (PEP 562 __getattr__, __all__ expansion) System-level (sys.modules, import hooks, zipimport, C extensions) Edge cases (complex circular imports, rare encodings)