Skip to main content

ros_license_toolkit

GitHub Workflow Status (with event) github lint GitHub issues GitHub prs PyPI python License

Warning For any legal questions, please consult a lawyer. This tool is not a substitute for legal advice.

Motivation

ROS packages must have licenses. This tool checks if the license declarations in the package.xml matches the license(s) of the code. We do this by using scancode-toolkit to scan the code and compare the results to the declaration in the package.xml

Presentation

ROSCon 2023 Presentation

Functionality

graph TD
    classDef stroke stroke:#333,stroke-width:2px;
    s([scan code for licenses and copyrights])
    class s stroke
    p[compare to\n package.xml\nfor linting]
    class p stroke
    c[create\ncopyright file\nfor release]
    class c stroke
    s --> p
    s --> c

Features

This checks:

Usage

Installation

Install the package from source:

pip install .

Basic Usage

You should then have the executable in your $PATH and can run it on any ROS package or a directory containing multiple ROS packages:

ros_license_toolkit my_ros_package

All Options

$ ros_license_toolkit -h
usage: ros_license_toolkit [-h] [-c] [-v] [-q] [-e] [-w] path

Checks ROS packages for correct license declaration.

positional arguments:
  path                  path to ROS2 package or repo containing packages

options:
  -h, --help            show this help message and exit
  -c, --generate_copyright_file
                        generate a copyright file
  -v, --verbose         enable verbose output
  -q, --quiet           disable most output
  -e, --continue_on_error
                        treats all errors as warnings, i.e. will give
                        returncode 0 even on errors
  -w, --warnings_as_error
                        treats all warnings as errors

Additionally, there is an option to ignore single files, folders and types of files. If there exists a .scanignore in the top level directory of a package, everything in it is going to be ignored. The file entries work similar to a .gitignore file, including making comments with #. One Example for a custom .scanignore file:

.git/* # folder
README.txt # file
README.* # file pattern

Per default, ros_license_toolkit ignores the following:

.scanignore
package.xml
setup.py
setup.cfg
CMakeLists.txt
.git/*

Using it as a GitHub action

You can use ros_license_toolkit inside your GitHub workflow in order to check licenses in your repository in each pull request. Use the following job inside your workflow file:

jobs:
  check_licenses:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: boschresearch/ros_license_toolkit@1.2.3

State of Development

WORK IN PROGRESS This is currently working and feature complete to the point it was originally intended. But there are still open points concerning testing and it is also very important to make sure how this behaves with existing ROS packages. In particular, the following things will have to be done:

To Do

  • Coverage analysis
  • Linter(s) per CI
  • Field trials (check existing ROS packages and see what to do with the results). see field-trials/
  • Allow license name in tag to be also full name of SPDX key.
  • Each LicenseTag should have SPDX id.
  • Single license tag without file attribute and single license text should match automatically.
  • Turn into github action.
  • Evaluate runtime. If scancode-toolkit takes too long on too many cases, we will have to look for an alternative.
  • Error of LicenseTagIsInSpdxListCheck must be a warning
  • Idea: Create pull requests for package maintainers automatically.

License

ros_license_toolkit is open-sourced under the Apache-2.0 license. See the LICENSE file for details.

Metadata

Release files for ros-license-toolkit 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ros-license-toolkit 2.1.2
File Size Uploaded Provenance Actions
ros_license_toolkit-2.1.2.tar.gz 30.1 kB Without provenance Details for ros_license_toolkit-2.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ros-license-toolkit 2.1.2
File Interpreter ABI Platform Actions
ros_license_toolkit-2.1.2-py3-none-any.whl Python 3 none any Details for ros_license_toolkit-2.1.2-py3-none-any.whl

Total release size: 68.7 kB

Release files / ros_license_toolkit-2.1.2.tar.gz

Download URL ros_license_toolkit-2.1.2.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a699b9141b2f6d57248c8e3b8ded9165c7b1c8a7c148e7198a579db43e1e4d64
BLAKE2b-256 checksum
How to use checksums
72394941663d8e9dfd9c4712f1538db22a8c031b03778991d612fef11298f969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ros_license_toolkit-2.1.2-py3-none-any.whl

Download URL ros_license_toolkit-2.1.2-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f57eb226b4c3cdef62a725cac4c951d8121cd4fb6d62f64e03e7b20a6255ab7
BLAKE2b-256 checksum
How to use checksums
1b2242e1a8879b23e2781e203db1c2966103ca4c0278ee55b0f3c7a577f8abb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ros-license-toolkit 2.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page