Skip to content

Commit ef6906a

Browse files
committed
Split the pip-licenses noxenv off to its own noxenv.
Dependencies of pip-tools shouldn't be included in the license check. I was lazy before and knew this could be the case, but now some CI is failing because of a new pip-tools dependency (albeit one whose license is fine just not on the known list) but it's good to make this properly go away as a possibility.
1 parent 158d73f commit ef6906a

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

noxfile.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,24 @@ def audit(session, installable):
9595
session.install("pip-audit", installable)
9696
session.run("python", "-m", "pip_audit")
9797

98-
if "format-nongpl" in installable:
99-
session.install("pip-licenses")
100-
session.run(
101-
"python",
102-
"-m",
103-
"piplicenses",
104-
"--ignore-packages",
105-
"pip-requirements-parser",
106-
"pip_audit",
107-
"pip-api",
108-
"--allow-only",
109-
";".join(NONGPL_LICENSES),
110-
)
98+
99+
@session()
100+
def license_check(session):
101+
"""
102+
Check that the non-GPL extra does not allow arbitrary licenses.
103+
"""
104+
session.install("pip-licenses", f"{ROOT}[format-nongpl]")
105+
session.run(
106+
"python",
107+
"-m",
108+
"piplicenses",
109+
"--ignore-packages",
110+
"pip-requirements-parser",
111+
"pip_audit",
112+
"pip-api",
113+
"--allow-only",
114+
";".join(NONGPL_LICENSES),
115+
)
111116

112117

113118
@session(tags=["build"])

0 commit comments

Comments
 (0)