LICENSE and NOTICE for pyiceberg-core

The pyiceberg-core wheels are a convenience artifact. We build them and upload them to PyPI as part of every release.

The Rust crates that pyiceberg-core depends on are statically linked into each wheel. So the LICENSE and NOTICE inside a wheel must cover those crates as well as iceberg-rust itself.

The sdist only contains iceberg-rust's own source, so it ships the root LICENSE and NOTICE unchanged.

How it works

LICENSE and NOTICE are generated at build time, before maturin builds and packages each wheel.

The generate-python-license action regenerates the wheel's LICENSE and NOTICE in bindings/python/:

  • LICENSE: the root LICENSE, then the cargo-about output, then the manual entries in third-party-licenses.txt.
  • NOTICE: the root NOTICE, then the manual entries in third-party-notices.txt.

The action is used in these workflows:

Note that in the repository, bindings/python/LICENSE and NOTICE are symlinks to the root files, so builds outside the release workflows ship the plain root files.

Relevant files

  • about.hbs: the cargo-about output template. Keep it a plain template.

  • about.toml: configures cargo-about.

    • accepted: the licenses we bundle, matching deny.toml. Add new ones at the end, as the order is the preference when a crate offers a choice.
    • targets: the wheel targets. Keep in sync with the build matrices in release_python.yml and release_python_nightly.yml.
    • Clarifications, for crates whose license files cargo-about can't read (such as libm). They pin the file by checksum (shasum -a 256 <file>). See the cargo-about docs.
  • third-party-licenses.txt: otherwise, add the license text here. For example, brotli-decompressor‘s MIT license, which the crate doesn’t ship. It names the crate and version, so re-check it when the crate is upgraded.

  • third-party-notices.txt: the NOTICE entries of dependencies that ship one (Arrow, Avro, moka). Find them from bindings/python (the repository's own crates appear too):

    cargo about generate -c about.toml --locked --fail --manifest-path Cargo.toml --format json \
      | jq -r '.crates[].package.manifest_path' | xargs -n1 dirname \
      | xargs -I{} find {} -maxdepth 1 -iname 'NOTICE*'
    

Keeping entries up to date

Pull request CI checks about.toml. It fails on a license that isn't in accepted, on a cargo about warning such as a stale clarification, and on <year> in the output, which means no license file was found. To reproduce a failure, run this from bindings/python:

make -s cargo-about | grep -n '<year>'

CI doesn't check the other entries. Before each release, from bindings/python, check that:

  • targets in about.toml matches the wheel targets in release_python.yml and release_python_nightly.yml.
  • Each crate in third-party-licenses.txt is in the make -s cargo-about output at the version the entry names. If the version changed, re-check the entry against the new version. If the crate is gone, remove the entry.
  • third-party-notices.txt matches the NOTICE files of the dependencies, found with the command in Relevant files.