Skip to content
Snippets Groups Projects
Verified Commit 5200b7f4 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

First commit

parents
No related branches found
No related tags found
No related merge requests found
---
# SPDX-FileCopyrightText: 2022 Laurent Modolo
#
# SPDX-License-Identifier: AGPL-3.0-or-later
title: "REUSE tool"
author: "Laurent Modolo"
date: "2022/12/01"
output:
beamer_presentation:
df_print: tibble
fig_caption: no
highlight: tango
latex_engine: xelatex
slide_level: 1
theme: metropolis
ioslides_presentation:
highlight: tango
slidy_presentation:
highlight: tango
classoption: aspectratio=169
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
# Why a Licence ?
\begin{center}
\begin{columns}
\column{0.8\textwidth}
\begin{quote}
Conformément à la
\href{https://www.legifrance.gouv.fr/affichTexte.do;jsessionid=6E9C9BD1F4AAF6E6FD525E8FE902A615.tplgfr26s_2?cidTexte=JORFTEXT000033202746\&categorieLien=id}{Loi
pour une République numérique du 7 octobre 2016}, les codes sources sont
des documents administratifs communicables et réutilisables. Dans le cas
où il est possible de choisir une licence libre,
\href{https://www.legifrance.gouv.fr/affichTexte.do?cidTexte=JORFTEXT000034502557\&categorieLien=id}{le
décret n° 2017-638 du 27 avril 2017} précise les familles de licences
qui peuvent être utilisées. La liste détaillée des licences avec leurs
versions est disponible sur le site
\href{https://www.data.gouv.fr/fr/licences}{data.gouv.fr}.
\end{quote}
\column{0.3\textwidth}
\includegraphics[width=\textwidth]{img/republique_numerique.png}
\end{columns}
\end{center}
\vspace{2em}
But more importantly:
- You are following the [guide of good practices for developpers](https://lbmc.gitbiopages.ens-lyon.fr/hub/good_practices/good_practices.html) at the LBMC
# [GNU Affero General Public License v3.0 or later](https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText)
\begin{center}
\begin{columns}
\column{0.8\textwidth}
The \href{https://spdx.org/licenses/AGPL-3.0-or-later.html}{AGPL-3}
\column{0.2\textwidth}
\includegraphics[width=\textwidth]{img/gnu.png}
\end{columns}
\end{center}
\vspace{-4em}
Like for the [GPL3](https://spdx.org/licenses/GPL-3.0-or-later.html) Users of [AGPL-3](https://spdx.org/licenses/AGPL-3.0-or-later.html)-licensed code must::
- **Include a copy of the full license text** and the original copyright notice
- State **all significant changes** made to the original software
- **Make available the source code** when you **distribute any works** based on the licensed software
- Include any **installation information necessary to update and reinstall** the software if the program is being used as part of a consumer device
But with a **twist**
# [GNU Affero General Public License v3.0 or later](https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText)
Section 13:
> Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. […]
If you let users access any AGPL licensed software **over a network, then that is also a form of distribution**. This is what the GPL had missed out
[Google opensource policy:](https://opensource.google/documentation/reference/using/agpl-policy)
> AGPL Policy
>
> WARNING: Code licensed under the GNU Affero General Public License (AGPL) MUST NOT be used at Google.
# What about the non-coding part of the project ?
Chance are that these parts also fall under the **administrative documents** category.
So you need to use an open licence with:
\begin{center}
\begin{columns}
\column{0.7\textwidth}
At least the autor attribution requirement:
\begin{itemize}
\item \href{https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf}{Licence Ouverte version 2.0}
\item \href{https://spdx.org/licenses/CC-BY-4.0.html}{Creative Commons Attribution 4.0}
\end{itemize}
\column{0.3\textwidth}
\includegraphics[width=\textwidth]{img/etalab.png}
\includegraphics[width=0.6\textwidth]{img/cc_by.png}
\end{columns}
\end{center}
\begin{center}
\begin{columns}
\column{0.7\textwidth}
But you can add the share alike requirement:
\begin{itemize}
\item \href{https://spdx.org/licenses/ODbL-1.0.html}{ODC Open Database License version 1.0}
\item \href{https://spdx.org/licenses/CC-BY-SA-4.0.html}{Creative Commons Attribution Share Alike 4.0}
\end{itemize}
\column{0.3\textwidth}
\includegraphics[width=\textwidth]{img/open_knowledge_fundation.png}
\includegraphics[width=0.6\textwidth]{img/cc_by.png}
\end{columns}
\end{center}
# REUSE
\begin{center}
\begin{columns}
\column{0.5\textwidth}
\includegraphics[width=\textwidth]{img/reuse.png}
\column{0.5\textwidth}
\begin{enumerate}
\item Choose and provide licenses
\item Add copyright and licensing information to each file
\item Confirm REUSE compliance
\end{enumerate}
\end{columns}
\end{center}
## Install REUSE
You will need **python3.6+** and **pip3**
```
pip3 install --user reuse
```
And that's all
# Initialize REUSE on a project
```
cd my_project_path
reuse init
```
will display this message:
```
Initializing project for REUSE.
What license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
```
What are [SPDX](https://spdx.dev/) ?
# *S*oftware *P*ackage *D*ata *E*xchange
Develop an open standard format and supporting tools for communicating the licenses and copyrights asssociated with software packages
- facilitate open source compliance and licencing information
- help users comply with the licenese for open source packages
- allows you to refer to licenses unambiguously
## [https://spdx.org/licenses/](https://spdx.org/licenses/)
# *S*oftware *P*ackage *D*ata *E*xchange
## [https://spdx.org/licenses/](https://spdx.org/licenses/)
\begin{tabular}{ l c }
Full name & Identifier \\
\hline
Apache License 2.0 & Apache-2.0 \\
GNU Lesser General Public License v3.0 or later & LGPL-3.0-or-later \\
GNU Affero General Public License v3.0 or later & AGPL-3.0-or-later\\
Creative Commons Attribution 4.0 International & CC-BY-4.0\\
Creative Commons Attribution Share Alike 4.0 International & CC-BY-SA-4.0\\
Etalab Open License 2.0 & etalab-2.0\\
\end{tabular}
# Initialize REUSE on a project
```
What license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
AGPL-3.0-or-later
What other license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
CC-BY-SA-4.0
What other license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
```
# Initialize REUSE on a project
```
What is the name of the project?
my project
What is the internet address of the project?
mywebsite.com
What is the name of the maintainer?
Laurent Modolo
What is the e-mail address of the maintainer?
laurent.modolo@ens-lyon.fr
All done! Initializing now.
Downloading AGPL-3.0-or-later
Downloading CC-BY-SA-4.0
Creating .reuse/dep5
Initialization complete.
```
# Initialize REUSE on a project
REUSE created a `LICENSES` folder with our two licenses
```
LICENSES
├── AGPL-3.0-or-later.txt
└── CC-BY-SA-4.0.txt
.reuse
└── dep5
```
The `dep5` file contains the additional informations that we entered.
# REUSE lint
```
reuse lint
```
```
# UNUSED LICENSES
The following licenses are not used:
* AGPL-3.0-or-later
* CC-BY-SA-4.0
# MISSING COPYRIGHT AND LICENSING INFORMATION
The following files have no copyright and licensing information:
...
```
# REUSE lint
```
# SUMMARY
* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses: AGPL-3.0-or-later, CC-BY-SA-4.0
* Used licenses:
* Read errors: 0
* Files with copyright information: 0 / 17
* Files with license information: 0 / 17
Unfortunately, your project is not compliant with
version 3.0 of the REUSE Specification :-(
```
# REUSE addheader
```
reuse addheader --license AGPL-3.0-or-later \
--copyright="Laurent Modolo" presentation.Rmd
```
```
head presentation.Rmd
```
```
<!--
SPDX-FileCopyrightText: 2022 Laurent Modolo
SPDX-License-Identifier: AGPL-3.0-or-later
-->
---
title: "REUSE tool"
author: "Laurent Modolo"
```
of course REUSE don't known the `Rmd` format...
# REUSE addheader
We have to manualy modify the comment
```
---
# SPDX-FileCopyrightText: 2022 Laurent Modolo
#
# SPDX-License-Identifier: AGPL-3.0-or-later
title: "REUSE tool"
author: "Laurent Modolo"
```
# REUSE addheader
```
reuse lint
...
* Used licenses: AGPL-3.0-or-later
* Read errors: 0
* Files with copyright information: 1 / 17
* Files with license information: 1 / 17
...
```
# REUSE addheader
If the file is not automatically detected we can use the `--style` option.
For R we can use:
`--style="python"`
For nextflow scripts:
`--style="c"`
# REUSE addheader
What if the file is not editable ?
```
reuse addheader --license="CC-BY-SA-4.0" \
--copyright="Laurent Modolo" img/*
```
```
Successfully changed header of img/open_knowledge_fundation.png.license
Successfully changed header of img/etalab.png.license
Successfully changed header of img/republique_numerique.png.license
Successfully changed header of img/reuse.png.license
Successfully changed header of img/cc_by_sa.png.license
Successfully changed header of img/cc_by.png.license
Successfully changed header of img/gnu.png.license
```
We now have `.license` file along the `im/*.png` files
# REUSE addheader
What if the file is editable but we don't want to ?
You can force the `.license` file creation with the `--force-dot-license`
```
reuse addheader --license="CC-BY-SA-4.0" \
--copyright="Laurent Modolo" data/test/data.csv data/test/data.fastq
```
Ignore part of a file
```
# REUSE-IgnoreStart
echo "SPDX-FileCopyrightText: $(date +'%Y') Jane Doe" > file.txt
echo "SPDX-License-Identifier: MIT" > file.txt
# REUSE-IgnoreEnd
```
# `reuse lint`
```
# SUMMARY
* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses:
* Used licenses: AGPL-3.0-or-later, CC-BY-SA-4.0
* Read errors: 0
* Files with copyright information: 310 / 310
* Files with license information: 310 / 310
Congratulations! Your project is compliant with version 3.0 of
the REUSE Specification :-)
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment