{"modulePath":"github.com/kehoej/contextception","version":"v1.0.8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package python\n\nPackage python implements import resolution for Python source files.\n\n## Types\n\n```go\ntype PackageRoot struct {\n\tPath            string // repo-relative path (e.g., \"src\", \".\")\n\tDetectionMethod string // \"pyproject_toml\", \"setup_py\", \"setup_cfg\", \"src_layout\", \"repo_root\"\n}\n```\nPackageRoot represents a detected Python package root directory.\n\n```go\ntype Resolver struct {\n\t// contains filtered or unexported fields\n}\n```\nResolver resolves Python import specifiers to repository files.\n\n```go\nfunc New(repoRoot string) *Resolver\n```\nNew creates a new Python resolver for the given repository root.\n\n```go\nfunc (r *Resolver) DetectPackageRoots() ([]PackageRoot, error)\n```\nDetectPackageRoots scans the repository for Python package root directories.\n\n```go\nfunc (r *Resolver) Resolve(srcFile string, fact model.ImportFact, repoRoot string) (model.ResolveResult, error)\n```\nResolve maps a Python import to a repository file.\n\n```go\nfunc (r *Resolver) SetPackageRoots(roots []PackageRoot)\n```\nSetPackageRoots allows setting package roots directly (used after loading from DB).\n\n","path":"github.com/kehoej/contextception/internal/resolver/python","name":"python","synopsis":"Package python implements import resolution for Python source files.","isRedistributable":true}
