checks.dependencies.DependenciesCheck

checks.dependencies.DependenciesCheck()

Check that declared dependencies match actual imports.

Only an unconditional module-level import of a third-party module can be undeclared. Guarded imports (see :mod:pycmdcheck.import_scan) and imports in tests shipped with the package only count as use.

Methods

Name Description
run Cross-reference pyproject.toml dependencies with imports.

run

checks.dependencies.DependenciesCheck.run(package_path, config)

Cross-reference pyproject.toml dependencies with imports.

Returns

: CheckResult

A CheckResult with:

: CheckResult
  • OK status if every unconditional import is declared and every declared dependency is imported
: CheckResult
  • NOTE status if a declared dependency is never imported, or none of the source files found could be parsed
: CheckResult
  • WARNING status if an unconditional import is not declared
: CheckResult
  • SKIPPED status if the dependencies are dynamic or cannot be read from pyproject.toml, or no source was found