Package: reuse
reusereuse is a tool for compliance with theREUSErecommendations.Documentation:https://reuse.readthedocs.ioandhttps://reuse.softwareSource code:https://github.com/fsfe/reuse-toolPyPI:https://pypi.python.org/pypi/reuseREUSE: 3.0Python: 3.8+Table of contentsBackgroundInstallUsageMaintainersContributingLicenseBackgroundCopyright and licensing is difficult, especially when reusing software from
different projects that are released under various different licenses.REUSEwas started by theFree Software Foundation Europe(FSFE) to provide a set of
recommendations to make licensing your Free Software projects easier. Not only
do these recommendations make it easier for you to declare the licenses under
which your works are released, but they also make it easier for a computer to
understand how your project is licensed.As a short summary, the recommendations are threefold:Choose and provide licensesAdd copyright and licensing information to each fileConfirm REUSE complianceYou are recommended to readour tutorialfor
a step-by-step guide through these three steps. TheFAQcovers basic questions about licensing,
copyright, and more complex use cases. Advanced users and integrators will find
thefull specificationhelpful.This tool exists to facilitate the developer in complying with the above
recommendations.There areother toolsthat have a lot more
features and functionality surrounding the analysis and inspection of copyright
and licenses in software projects. The REUSE helper tool, on the other hand, is
solely designed to be a simple tool to assist in compliance with the REUSE
recommendations.InstallInstallation via package manager (Recommended)There are packages available for easy install on many operating systems. You are
welcome to help us package this tool for more distributions!An automatically generated list can be found atrepology.org, without any
guarantee for completeness.Install and run via pipx (Recommended)The following one-liner both installs and runs this tool fromPyPIviapipx:pipxrunreuselintpipx automatically isolates reuse into its own Python virtualenv, which means
that it won't interfere with other Python packages, and other Python packages
won't interfere with it.If you want to be able to use reuse without prepending it withpipx runevery
time, install it globally like so:pipxinstallreusereuse will then be available in~/.local/bin, which must be added to your$PATH.After this, make sure that~/.local/binis in your$PATH. On Windows, the
required path for your environment may look like%USERPROFILE%\AppData\Roaming\Python\Python39\Scripts, depending on the Python
version you have installed.To upgrade reuse, run this command:pipxupgradereuseFor full functionality, the following pieces of software are recommended:GitMercurial 4.3+PijulInstallation via pipTo install reuse into~/.local/bin, run:pip3install--userreuseSubsequently, make sure that~/.local/binis in your$PATHlike described in
the previous section.To upgrade reuse, run this command:pip3install--user--upgradereuseInstallation from sourceYou can also install this tool from the source code, but we recommend the
methods above for easier and more stable updates. Please make sure the
requirements for the installation via pip are present on your machine.pipinstall.UsageFirst, read theREUSE tutorial. In a
nutshell:Put your licenses in theLICENSES/directory.Add a comment header to each file that saysSPDX-License-Identifier: GPL-3.0-or-later, andSPDX-FileCopyrightText: $YEAR $NAME. You can be flexible with the format,
just make sure that the line starts withSPDX-FileCopyrightText:.Verify your work using this tool.Example of header:# SPDX-FileCopyrightText: 2017 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC-BY-SA-4.0CLITo check against the recommendations, usereuse lint:~/Projects/reuse-tool $ reuse lint
[...]

Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)This tool can do various more things, detailed in the documentation. Here a
short summary:annotate--- Add copyright and/or licensing information to the header of a
file.download--- Download the specified license into theLICENSES/directory.init--- Set up the project for REUSE compliance.lint--- Verify the project for REUSE compliance.spdx--- Generate an SPDX Document of all files in the project.supported-licenses--- Prints all licenses supported by REUSE.Example demoIn this screencast, we are going to follow thetutorial, making theREUSE example repositorycompliant.Run in DockerThefsfe/reuseDocker image is available onDocker Hub. With it, you can easily
include REUSE in CI/CD processes. This way, you can check for REUSE compliance
for each build. In ourresources for developersyou can learn how to integrate the REUSE tool in Drone, Travis, GitHub, or
GitLab CI.You can run the helper tool simply by providing the command you want to run
(e.g.,lint,spdx). The image's working directory is/databy default. So
if you want to lint a project that is in your current working directory, you can
mount it on the container's/datadirectory, and tell the tool to lint. That
looks a little like this:dockerrun--rm--volume$(pwd):/datafsfe/reuselintYou can also provide additional arguments, like so:dockerrun--rm--volume$(pwd):/datafsfe/reuse--include-submodulesspdx-oout.spdxThe available tags are:latest--- the most recent release of reuse.{major}--- the latest major release.{major}.{minor}--- the latest minor release.{major}.{minor}.{patch}--- a precise release.You can add-debianto any of the tags to get a Debian-based instead of an
Alpine-based image, which is larger, but may be better suited for license
compliance.Run as pre-commit hookYou can automatically runreuse linton every commit as a pre-commit hook for
Git. This usespre-commit. Once youhave it installed, add this to the.pre-commit-config.yamlin your repository:repos:-repo:https://github.com/fsfe/reuse-toolrev:v3.0.1hooks:-id:reuseThen runpre-commit install. Now, every time you commit,reuse lintis run
in the background, and will prevent your commit from going through if there was
an error.MaintainersCarmen Bianca Bakkercarmenbianca@fsfe.orgMax Mehlmax.mehl@fsfe.orgLinus Sehnlinus@fsfe.orgContributingIf you're interested in contributing to the reuse project, there are several
ways to get involved. Development of the project takes place on GitHub athttps://github.com/fsfe/reuse-tool. There, you can submit bug reports, feature
requests, and pull requests. Even and especially when in doubt, feel free to
open an issue with a question. Contributions of all types are welcome, and the
development team is happy to provide guidance and support for new contributors.Additionally, thereuse@lists.fsfe.orgmailing list is available for
discussion and support related to the project.You can find the full contribution guidelines athttps://reuse.readthedocs.io/en/latest/contributing.html.LicenseThis work is licensed under multiple licences. Because keeping this section
up-to-date is challenging, here is a brief summary as of February 2023:All original source code is licensed under GPL-3.0-or-later.All documentation is licensed under CC-BY-SA-4.0.Some configuration and data files are licensed under CC0-1.0.Some code borrowed fromspdx/tools-pythonis licensed under
Apache-2.0.For more accurate information, check the individual files.