reuse is a Python command-line tool designed to help projects achieve and verify compliance with the REUSE recommendations (https://reuse.software). It facilitates adding copyright and licensing information to files, checking existing compliance, and downloading SPDX license texts. The current version is 6.2.0, with releases occurring regularly, typically every few months for minor versions.
pip install reuseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `reuse` tool programmatically by directly calling its `main` function. It simulates command-line execution by manipulating `sys.argv` and creating a temporary project structure to run `lint` and `spdx` commands.
To resolve new false positives, ensure any ignored sections are explicitly marked with `REUSE-IgnoreStart` and `REUSE-IgnoreEnd` tags in the relevant files.
As a workaround, you can force the use of `chardet` for encoding detection by setting the environment variable: `REUSE_ENCODING_MODULE=chardet reuse <command>`.
For scripting and automation, prefer invoking `reuse` as a subprocess (`subprocess.run(['reuse', ...])`) for maximum stability and robustness, rather than relying on direct imports of internal modules.