def license_check(session):
    """
    Check that the non-GPL extra does not allow arbitrary licenses.
    """
    session.install("pip-licenses", f"{ROOT}[format-nongpl]")
    session.run(
        "python",
        "-m",
        "piplicenses",
        "--ignore-packages",

        # because they're not our deps
        "pip-requirements-parser",
        "pip_audit",
        "pip-api",

        # because pip-licenses doesn't yet support PEP 639 :/
        "attrs",
        "jsonschema",
        "referencing",

        "--allow-only",
        ";".join(NONGPL_LICENSES),
    )
Check that the non-GPL extra does not allow arbitrary licenses.
noxfile.py