Repository navigation
Check dependency licenses in CI (Rust and Python) - #327
Open
zuhalsicim wants to merge 1 commit into
Open
zuhalsicim wants to merge 1 commit into
zuhalsicim wants to merge 1 commit into
Conversation
Fixes restatedev#182. cargo-deny checks the crates of the native extension against deny.toml, and pip-licenses checks the Python packages of every extra against [tool.pip-licenses] in pyproject.toml. Both allow lists start from the ones in the issue. - deny.toml also allows CDLA-Permissive-2.0 (webpki-root-certs, as in restatedev/restate) and clarifies cfg_block, whose only license info is a LICENSE file with the Apache-2.0 notice. - Cargo.toml gets license = "MIT", so the crate itself has a license field. The wheel metadata still comes from pyproject.toml. - pyproject.toml matches license names exactly; besides the issue's names it allows MIT-0 (cffi) and the four SPDX expressions in use. - actions.lock is updated with gh actions-lock.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #182 (part of restatedev/restate#4491).
This adds a "Dependency licenses" workflow with two jobs:
cargo deny check licenseswith a newdeny.toml, using the same action version as restatedev/restate (EmbarkStudios/cargo-deny-action@v2.1.1).uv sync --all-extras --no-install-project(no SDK build) and runsuvx pip-licenses@5.5.5, which reads its allow list from[tool.pip-licenses]inpyproject.toml.It runs on PRs and pushes to main that touch
Cargo.toml,Cargo.lock,deny.toml,pyproject.toml,uv.lockor the workflow, likedeps.ymlin restate.The lists from the issue needed a few changes to pass on today's lockfiles:
deny.tomlalso allowsCDLA-Permissive-2.0.webpki-root-certs(Mozilla's root certificates) has only that license. Restate'sdeny.tomlallows it too.cfg_block(viaturso_core) has nolicensefield, only a LICENSE file with the Apache-2.0 notice. Aclarifyentry pins it to that file's hash, so it stops applying if the file changes.Cargo.tomlgetslicense = "MIT", since the crate itself had no license field. The wheel does not change: maturin takes the license from[project]inpyproject.toml, because it is not listed indynamic.MIT License, aiosqlite). So the allow list has both spellings of each license from the issue, plusMIT-0(cffi) and the four SPDX expressions in use, for exampleMPL-2.0 AND (Apache-2.0 OR MIT)(orjson).I left
--partial-matchoff on purpose. With it, a package licensedMIT AND GPL-3.0-onlypasses, because "MIT" is a substring. With exact names it fails, and a new license string needs someone to read it and add it.actions.lockis regenerated withgh actions-lockv0.4.0, andgh actions-lock --verifypasses.How I tested it
Python, against the 105 locked packages of all extras (Windows, Python 3.12):
Rust: I don't have cargo-deny locally, so I took the license field of all 393 crates in
Cargo.lockfrom crates.io and checked them againstdeny.tomlwith the same rules (SPDX expressions,/as OR). All pass; withoutCDLA-Permissive-2.0,webpki-root-certsfails. Thecfg_blockhash is computed the way cargo-deny does it. So therustjob in this PR is the first real cargo-deny run.Also
ruff format --check,ruff check, andzizmor --offlineon the new workflow (no findings).