7.2. Licensing¶
7.2.1. What is a License¶
A license specify the conditions on sharing and distributing your code. Without a license users are not able to use your code.
pasteur practical guide about software licensing:
7.2.2. Which License to choose¶
There is 2 kind of open source licenses:
The licenses with copy left (aka viral license)
The licences with no copy left (aka non viral license)
If you release your code under a viral license, a person you create a new code based on your software must release it's code with an equivalent license. The most famous is the GNU Licenses family GPL, LGPL, aGPL. Whereas under a non viral license (MIT, BSD) the person who modify or redistribute your code can choose it's own license. But in the 2 cases the user must declare the origin of the code and cite you.
Before making your code public
it is essential to specify the conditions on sharing and distributing it: define a licence and copyright terms and specify the list of authors.
if you intend to filing a patent on a software, or have a commercial activity with a software contact the DARRI before to make your code public (github or opening your gitlab repository, ...)
So the choice of a license depend of :
my software is based on another software? if yes you have to choose a compliant license
do I want that the other redistribute my software under the same license?
7.2.2.1. Strong copyleft¶
(GNU GPLv3 and others): this family of licences is considered to be protective and reciprocal, and generally ensures that any changes and/or redistributions preserve the same obligations as the original licence.
https://www.gnu.org/licenses/gpl-3.0.en.html https://www.gnu.org/licenses/agpl-3.0.en.html
7.2.2.2. Weak copyleft¶
(GNU LGPL and others): this licence is similar to the previous one, but with an important distinction that allows software under this licence to be included in other software components without these components having to release their source code.
7.2.2.3. Permissive¶
(BSD/MIT and others): this licence imposes very few restrictions on how the software is executed, studied, redistributed and modified
https://opensource.org/licenses/BSD-3-Clause https://opensource.org/licenses/MIT
7.2.3. Practically how to add a License to my software¶
It's pretty easy. You have to copy the term of the license at the root of your project usually under the name of COPYING (GPL family) or LICENSE (MIT/BSD) (for LGPL you hav to download 2 files COPYING and COPYING.LESSER) and a header referencing this license in every file code of your project. Usually the code is released under GPL/BSD/MIT license whereas documentation is released under creative commons license.
7.2.3.1. Python project¶
The license file is placed at the project root as COPYING as specified by GPLv3 license. For MIT/BSD licenses the file is named LICENSE.

and each file code must include a header

7.2.3.2. Dockerfile¶
Below a Dockerfile with a license header. Note that the license and the provider (vendor) can be mentioned also with LABEL.
1#########################################################################
2# MacSyFinder - Detection of macromolecular systems in protein dataset #
3# using systems modelling and similarity search. #
4# Authors: Sophie Abby, Bertrand Neron #
5# Copyright (c) 2014-2021 Institut Pasteur (Paris) and CNRS. #
6# See the COPYRIGHT file for details #
7# #
8# This file is part of MacSyFinder package. #
9# #
10# MacSyFinder is free software: you can redistribute it and/or modify #
11# it under the terms of the GNU General Public License as published by #
12# the Free Software Foundation, either version 3 of the License, or #
13# (at your option) any later version. #
14# #
15# MacSyFinder is distributed in the hope that it will be useful, #
16# but WITHOUT ANY WARRANTY; without even the implied warranty of #
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
18# GNU General Public License for more details . #
19# #
20# You should have received a copy of the GNU General Public License #
21# along with MacSyFinder (COPYING). #
22# If not, see <https://www.gnu.org/licenses/>. #
23#########################################################################
24
25FROM ubuntu:groovy
26
27LABEL org.opencontainers.image.authors="Bertrand Neron <bneron@pasteur.fr>"
28LABEL org.label-schema.vendor='Institut Pasteur'
29LABEL org.label-schema.vcs-url='https://github.com/gem-pasteur/macsyfinder'
30LABEL license="GPLv3"
31
32USER root
33ARG DEBIAN_FRONTEND=noninteractive
34
35RUN apt-get update -y &&\
36 apt-get install -y --no-install-recommends hmmer python3 python3-pip git
37RUN apt-get clean -y
38
39RUN cd /tmp &&\
40 git clone https://github.com/gem-pasteur/macsyfinder.git &&\
41 cd macsyfinder &&\
42 python3 -m pip install . &&\
43 install -m 755 Docker/Macsyfinder/macsyfinder-entrypoint.sh /usr/local/bin &&\
44 cd /tmp &&\
45 rm -Rf macsyfinder
46
47ENV DEBIAN_FRONTEND teletype
48ENV PYTHONIOENCODING UTF-8
49
50RUN useradd -m msf
51USER msf
52WORKDIR /home/msf
53
54CMD macsyfinder --help
55ENTRYPOINT ["/usr/local/bin/macsyfinder-entrypoint.sh"]
7.2.3.3. Singularity file¶
Below a singularity recipe with a license header and labels
1###########################################################################
2# #
3# This file is part of Counter RNAseq Window (craw) package. #
4# #
5# Authors: Bertrand Neron #
6# Copyright (c) 2017-2019 Institut Pasteur (Paris). #
7# see COPYRIGHT file for details. #
8# #
9# craw is free software: you can redistribute it and/or modify #
10# it under the terms of the GNU General Public License as published by #
11# the Free Software Foundation, either version 3 of the License, or #
12# (at your option) any later version. #
13# #
14# craw is distributed in the hope that it will be useful, #
15# but WITHOUT ANY WARRANTY; without even the implied warranty of #
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
17# See the GNU General Public License for more details. #
18# #
19# You should have received a copy of the GNU General Public License #
20# along with craw (see COPYING file). #
21# If not, see <http://www.gnu.org/licenses/>. #
22# #
23###########################################################################
24
25Bootstrap: docker
26from: ubuntu:bionic
27
28
29%labels
30 maintainer Bertrand Neron <bneron@pasteur.fr>
31 licence GPLv3
32 package.name craw
33 package.version latest
34 package.homepage https://gitlab.pasteur.fr/bneron/craw
35 package.license GPLv3
36
37%post
38 ####################################
39 # Installing system #
40 ####################################
41
42 apt-get update -y
43 apt-get install -y --no-install-recommends python3 python3-tk
44 apt-get install -y git
45 apt-get install -y python3-pip
46
47 #################################
48 # installing craw #
49 #################################
50 export PYTHONNOUSERSITE=1
51 # don't add user site-packages directory to sys.path.
52 # this avoid to interact with ~/.local
53 cd /usr/local/src
54 git clone https://gitlab.pasteur.fr/bneron/craw/
55 cd craw
56 pip3 install .
57
58 mkdir /craw
59 mv tests /craw/
60
61 #################################
62 # cleaning image #
63 #################################
64 apt-get purge -y git
65 apt-get autoremove -y
66 apt-get clean -y
67
68%environment
69 # to be reproducible we should never search
70 # in python user cache which is the user home
71 # and is mounted automically
72 export PYTHONNOUSERSITE=1
73
74%test
75 /usr/bin/python3 /craw/tests/run_tests.py -vv
76
77%help
78 This singularity image contains the Counter RNAseq Window (CRAW) package.
79 Two commands are available \"coverage\" and \"htmp\.
80 To run command:
81 ./craw.img [coverage|htmp] [options]... [args]... .
82
83 To get help about each command ./craw.img [coverage|htmp] --help.
84 The detailed documentation is accessible here: http://bneron.pages.pasteur.fr/craw/
85
86%runscript
87
88# the following syntax allow to get the command and args
89# in POSIX manner so compliant with dash which
90# is the debian/ubuntu /bin/sh shell
91
92CMD="$1"
93shift
94ARGS=${@}
95
96case ${CMD} in
97 coverage )
98 exec /usr/local/bin/craw_coverage ${ARGS} ;;
99 htmp )
100 exec /usr/local/bin/craw_htmp ${ARGS} ;;
101 * )
102 echo "command \"${CMD}\" is not supported. available commands: \"coverage\"|\"htmp\""
103 exit 127
104 ;;
105esac
Warning
If you create an image of a third party software, and push this image on docker hub. You redistribute the software. So you have to check if you have the right to do this. Check the licenses !
7.2.4. Copyright¶
You have the authorship on your software, but the Institut Pasteur have the copyright on every software you develop during you work at the IP.
To specify the copyrigth you can add a COPYRIGHT file which specify who have the copyright on the software. If your unit as several affiliations, don't forget to mention each of them. for instance for a Institut Pasteur unit which is also affiliate to CNRS
Copyright (c) 2014-2021 Institut Pasteur (Paris) and CNRS.
The copyright may vary over the time. For instance below an example of copyright for a project whose development has started before the developer reach pasteur.
###############################################################################
# correlationplus - A Python package to calculate, visualize and analyze #
# dynamical correlations maps of proteins. #
# Authors: Mustafa Tekpinar #
# Copyright Mustafa Tekpinar 2017-2018 #
# Copyright CNRS-UMR3528, 2019 #
# Copyright Institut Pasteur Paris, 2020-2021 #
# #
# This file is part of correlationplus. #
...
7.2.5. Contributors¶
It's fair to also mention people who contribute to the project. The are 2 politics:
mention only people who contribute to the code
mention every one have a contribution and specify what kind of contribution

Above the list of all MacSyFinder contributors with their respective contributions (code, ideas, testing, ...)¶