Documentation ¶
Overview ¶
Package python provides analysers for Python projects.
A `BuildTarget` in Python is the directory of the Python project, generally containing `requirements.txt` or `setup.py`.
Index ¶
- Constants
- Variables
- func AnalyzePip(dir module.Filepath, target module.Filepath) (graph.Deps, *errors.Error)
- func AnalyzePipDepTree(dir module.Filepath, target module.Filepath) (graph.Deps, *errors.Error)
- func AnalyzePipenv(dir module.Filepath, target module.Filepath) (graph.Deps, *errors.Error)
- func AnalyzeRequirementsTxt(dir module.Filepath, target module.Filepath) (graph.Deps, *errors.Error)
- func AnalyzeSetupPy(dir module.Filepath, target module.Filepath) (graph.Deps, *errors.Error)
- func Discover(dir string, options map[string]interface{}) ([]module.Module, error)
- func FromRequirements(reqs []pip.Requirement) []pkg.Import
- func FromTree(tree []pip.DepTree) ([]pkg.Import, map[pkg.ID]pkg.Package)
- func NewDiscover(dir module.Filepath) (map[module.Filepath]module.DiscoveredStrategies, *errors.Error)
- type Analyzer
- type Options
Constants ¶
View Source
const ( AnalyzerName = "python" SetupPyStrategy = "setuptools" PipStrategy = "pip" PipenvStrategy = "pipenv" PipDepTreeStrategy = "deptree" RequirementsTxtStrategy = "requirements" )
Variables ¶
View Source
var PythonAnalyzer = module.AnalyzerV2{ Name: AnalyzerName, DiscoverFunc: NewDiscover, Strategies: module.Strategies{ Named: map[module.StrategyName]module.Strategy{ SetupPyStrategy: AnalyzeSetupPy, PipStrategy: AnalyzePip, PipenvStrategy: AnalyzePipenv, PipDepTreeStrategy: AnalyzePipDepTree, RequirementsTxtStrategy: AnalyzeRequirementsTxt, }, SortedNames: []module.StrategyName{PipenvStrategy, PipDepTreeStrategy, PipStrategy, RequirementsTxtStrategy, SetupPyStrategy}, Optimal: []module.StrategyName{PipenvStrategy}, }, }
Functions ¶
func AnalyzePip ¶ added in v1.0.9
func AnalyzePipDepTree ¶ added in v1.0.9
func AnalyzePipenv ¶ added in v1.0.9
func AnalyzeRequirementsTxt ¶ added in v1.0.9
func AnalyzeSetupPy ¶ added in v1.0.9
func Discover ¶
Discover constructs modules in all directories with a `requirements.txt` or `setup.py`.
func FromRequirements ¶
func FromRequirements(reqs []pip.Requirement) []pkg.Import
func NewDiscover ¶ added in v1.0.9
Types ¶
Click to show internal directories.
Click to hide internal directories.