Skip to content

How it works

The pipeline runs in six steps:

  1. Read: enumerate the installed packages in the target environment's site-packages and walk each package's Requires-Dist to build the dependency tree. Direct dependencies are the ones the project declares, from its installed metadata and from pyproject.toml ([project] dependencies and extras, dependency groups, and uv's and Poetry's dev tables), so a project that isn't installed into its own environment, uv's default for applications, still has them. Any other installed package counts as direct when nothing else installed requires it. A dependency the project requires that isn't installed is reported and fails the policy, since its license can't be read. A package installed from a directory inside the project, such as a uv workspace member, is part of the project: it isn't audited, though its dependencies are.
  2. Detect: read each package's installed *.dist-info/METADATA. Licenses come from user overrides (normalized to canonical SPDX and validated at config load), or from PEP 639 License-Expression, which is authoritative when present. Otherwise the legacy License field and trove classifiers are consulted, and the first with a recognized license wins. Several license classifiers that map to SPDX combine with OR, read as a dual license, with a warning when they fall in different categories (MIT and GPL-3.0-only); a license classifier that can't be mapped alongside them is reported in a warning rather than dropped silently. Strings are normalized against the full SPDX license list, so any valid SPDX expression is kept intact; a declared license that can't be normalized is preserved verbatim (rather than discarded) so the report shows the actual string.
  3. Classify: categorize each license as permissive, weak-copyleft, strong-copyleft, network-copyleft, or proprietary using OSADL copyleft data, plus built-in categories for a few common permissive licenses it leaves out (see Limitations). Any other valid SPDX license that data doesn't cover reports as unknown until you classify it.
  4. Analyze: check that some outbound license satisfies every dependency under the OSADL matrix, and when none does, name the conflict: each pair of licenses that share no outbound license, or else the group that can't all be satisfied at once although every pair of them can (EUPL-1.1, Apache-2.0, and MPL-1.1). Dependencies count as separate libraries: a permissive or weak-copyleft one never constrains a permissive or weak-copyleft outbound license, while a strong- or network-copyleft one needs a copyleft outbound license that the matrix allows for every dependency (see Limitations).
  5. Recommend: list the outbound licenses that satisfy every dependency, most permissive first. Where OSADL's verdict is "Check dependency" (compatibility depends on how the code is combined), the license passes the conflict check but isn't recommended outright: when no license is a definite fit, those are listed as needing review instead, so a passing check always leaves a license to choose, unless what's left can't be checked against a license you classified (see license-classifications) or one the OSADL matrix leaves out (see Limitations). A dual-licensed dependency (MIT OR GPL-2.0) can be used under any one of its alternatives, so an outbound license that satisfies any of them is accepted, here and in the conflict check. Its category, which the policy check uses, comes from its most permissive alternative, and an alternative with a license of no known category is relied on in neither while another remains.
  6. Report: render findings as terminal output, Markdown, JSON, or third-party notices.

Because license-audit reads an already-installed environment, you provision it however you like first (uv sync, poetry install, pip install -e .). Whatever is installed is what gets audited, so choosing dependency groups is just a matter of how you provision.