Skip to main content

python_import_candidates

Function python_import_candidates 

Source
pub fn python_import_candidates(
    import_path: &str,
    packages: &[PythonPackage],
    current_file_path: Option<&str>,
) -> Vec<String>
Expand description

The paths a Python import can name, most specific first: a/b.py, then a/b/__init__.py (a package). Absolute imports need a package of the workspace whose name is the first component; relative ones (..x) are taken from current_file_path. No candidate starts with /: a package at the index root has an empty project root.