Skip to main content

python_declared_import_root

Function python_declared_import_root 

Source
pub fn python_declared_import_root(file: &ProjectFile) -> Option<PathBuf>
Expand description

The root a packaging manifest declares for this file, whether that root is the project root itself or a directory below it.

pyproject.toml’s tool.setuptools.packages.find.where and setup.py’s package_dir state where a project’s packages begin: a file below one of them is named from that directory and from nowhere else. where = ["."] declares the project root, and a declaration of the project root is a declaration like any other: it says this project’s packages begin here, so a shorter spelling below that root names a different arrangement of the same directories. Only a project whose packaging configuration does not cover this file answers None (#3506).