From f5186f070dda725450207f502a0d89de36042e3c Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Fri, 18 Nov 2022 12:07:26 +0100 Subject: [PATCH 1/3] [pre-commit] Add reuse --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3564a4..0ac1946 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: @@ -46,3 +50,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: debug-statements + - repo: https://github.com/fsfe/reuse-tool + rev: v1.0.0 + hooks: + - id: reuse -- GitLab From a53daab16cfaa5a590163642852301e8b20e6d54 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Fri, 18 Nov 2022 13:19:52 +0100 Subject: [PATCH 2/3] [reuse] Make project reuse compliant --- .flake8 | 4 ++++ .gitignore | 8 ++++++++ .gitlab-ci.yml | 4 ++++ .reuse/dep5 | 8 ++++++++ LICENSE | 27 --------------------------- LICENSES/BSD-3-Clause.txt | 11 +++++++++++ MANIFEST.in | 4 ++++ README.md | 6 ++++++ conda/meta.yaml | 4 ++++ doc/api.rst | 4 ++++ doc/click.rst | 4 ++++ doc/conf.py | 4 ++++ doc/config.rst | 4 ++++ doc/data/basic_config.py | 4 ++++ doc/data/second_config.py | 4 ++++ doc/example_alias.py | 4 ++++ doc/example_cli.py | 4 ++++ doc/example_config.py | 4 ++++ doc/example_defaults.py | 4 ++++ doc/example_logging.py | 4 ++++ doc/example_options.py | 4 ++++ doc/index.rst | 4 ++++ doc/install.rst | 4 ++++ doc/links.rst | 4 ++++ doc/logging.rst | 4 ++++ doc/nitpick-exceptions.txt | 4 ++++ doc/rc.rst | 4 ++++ pyproject.toml | 4 ++++ setup.py | 4 ++++ src/exposed/click.py | 4 ++++ src/exposed/config.py | 4 ++++ src/exposed/logging.py | 4 ++++ src/exposed/rc.py | 4 ++++ tests/conftest.py | 4 ++++ tests/test_click.py | 4 ++++ tests/test_config.py | 4 ++++ tests/test_logging.py | 4 ++++ tests/test_rc.py | 4 ++++ 38 files changed, 165 insertions(+), 27 deletions(-) create mode 100644 .reuse/dep5 delete mode 100644 LICENSE create mode 100644 LICENSES/BSD-3-Clause.txt diff --git a/.flake8 b/.flake8 index 2534a45..a7cb63d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + [flake8] max-line-length = 80 ignore = E501,W503,E302,E402,E203 diff --git a/.gitignore b/.gitignore index 13747f2..8016e89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + *~ *.swp *.pyc @@ -14,3 +18,7 @@ html/ build/ doc/api/ dist/ +.mypy_cache/ +.pytest_cache/ +cache/ +venv/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0d76ba..cf88fa0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + include: - project: bob/dev-profile ref: master diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000..0f2bca5 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,8 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: exposed +Upstream-Contact: Andre Anjos <andre.anjos@idiap.ch> +Source: https://gitlab.idiap.ch/bob/exposed + +Files: tests/data/* +Copyright: Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +License: BSD-3-Clause diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 1b520f6..0000000 --- a/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2022 Idiap Research Institute, http://www.idiap.ch/ -Written by Andre Anjos <andre.anjos@idiap.ch> - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt new file mode 100644 index 0000000..086d399 --- /dev/null +++ b/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,11 @@ +Copyright (c) <year> <owner>. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in index ce169d9..1064d23 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + include LICENSE README.md recursive-include doc *.rst *.txt *.py *.ico *.png recursive-include tests/data *.py *.cfg diff --git a/README.md b/README.md index 0450211..66e9cf4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +<!-- +Copyright © 2022 Idiap Research Institute <contact@idiap.ch> + +SPDX-License-Identifier: BSD-3-Clause +--> + [](https://www.idiap.ch/software/bob/docs/bob/exposed/master/sphinx/index.html) [](https://gitlab.idiap.ch/bob/exposed/commits/master) [](https://www.idiap.ch/software/bob/docs/bob/exposed/master/coverage/index.html) diff --git a/conda/meta.yaml b/conda/meta.yaml index 77e74a2..9a4e50f 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + {% set data = load_file_data(RECIPE_DIR + '/../pyproject.toml') %} package: diff --git a/doc/api.rst b/doc/api.rst index 4da44f9..fd08f7b 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.api: ============ diff --git a/doc/click.rst b/doc/click.rst index 60a886e..b4a254e 100644 --- a/doc/click.rst +++ b/doc/click.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.click: ====================== diff --git a/doc/conf.py b/doc/conf.py index 920cb8b..c3255eb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import os import time diff --git a/doc/config.rst b/doc/config.rst index ec5ec36..4f5f06e 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.config: ==================================== diff --git a/doc/data/basic_config.py b/doc/data/basic_config.py index 7dc4a1b..a34ef7c 100644 --- a/doc/data/basic_config.py +++ b/doc/data/basic_config.py @@ -1,2 +1,6 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + a = 1 b = a + 2 diff --git a/doc/data/second_config.py b/doc/data/second_config.py index c908703..3b0fae7 100644 --- a/doc/data/second_config.py +++ b/doc/data/second_config.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + # the b variable from the last config file is available here c = b + 1 # noqa: F821 b = b + 3 # noqa: F821 diff --git a/doc/example_alias.py b/doc/example_alias.py index 9c67734..a7603a3 100644 --- a/doc/example_alias.py +++ b/doc/example_alias.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """An example script to demonstrate config-file option readout.""" # To improve loading performance, we recommend you only import the very diff --git a/doc/example_cli.py b/doc/example_cli.py index bd53e1c..bad2893 100644 --- a/doc/example_cli.py +++ b/doc/example_cli.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """An example script to demonstrate config-file option readout.""" # To improve loading performance, we recommend you only import the very diff --git a/doc/example_config.py b/doc/example_config.py index 416883b..d80a401 100644 --- a/doc/example_config.py +++ b/doc/example_config.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + from exposed.click import config_group from exposed.logging import setup diff --git a/doc/example_defaults.py b/doc/example_defaults.py index 904f06b..1ea21de 100644 --- a/doc/example_defaults.py +++ b/doc/example_defaults.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + from exposed.click import user_defaults_group from exposed.logging import setup from exposed.rc import UserDefaults diff --git a/doc/example_logging.py b/doc/example_logging.py index 7ec571a..56492ff 100644 --- a/doc/example_logging.py +++ b/doc/example_logging.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import logging from exposed.logging import setup diff --git a/doc/example_options.py b/doc/example_options.py index 1b68dff..b86df80 100644 --- a/doc/example_options.py +++ b/doc/example_options.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + integer = 1000 flag = True choice = "blue" diff --git a/doc/index.rst b/doc/index.rst index 96084f7..c1d358a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed: ==================================================== diff --git a/doc/install.rst b/doc/install.rst index de3c61a..6c5d3d9 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.install: ============== diff --git a/doc/links.rst b/doc/links.rst index d1c7da4..2404c76 100644 --- a/doc/links.rst +++ b/doc/links.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _python: http://www.python.org .. _pip: https://pip.pypa.io/en/stable/ .. _mamba: https://mamba.readthedocs.io/en/latest/index.html diff --git a/doc/logging.rst b/doc/logging.rst index 4f150cb..27853f0 100644 --- a/doc/logging.rst +++ b/doc/logging.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.logging: ============================ diff --git a/doc/nitpick-exceptions.txt b/doc/nitpick-exceptions.txt index af6fe3e..c63c7f7 100644 --- a/doc/nitpick-exceptions.txt +++ b/doc/nitpick-exceptions.txt @@ -1 +1,5 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + py:class module diff --git a/doc/rc.rst b/doc/rc.rst index eea7105..b79d0d8 100644 --- a/doc/rc.rst +++ b/doc/rc.rst @@ -1,3 +1,7 @@ +.. Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +.. +.. SPDX-License-Identifier: BSD-3-Clause + .. _exposed.rc: ============================== diff --git a/pyproject.toml b/pyproject.toml index 8b11404..60462bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + [build-system] requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 6068493..6aeeebe 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + from setuptools import setup setup() diff --git a/src/exposed/click.py b/src/exposed/click.py index 7e7fb02..a25a6ed 100644 --- a/src/exposed/click.py +++ b/src/exposed/click.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """Helpers to build command-line interfaces (CLI) via :py:mod:`click`.""" from __future__ import annotations diff --git a/src/exposed/config.py b/src/exposed/config.py index 533827c..aae933e 100644 --- a/src/exposed/config.py +++ b/src/exposed/config.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """Functionality to implement python-based config file parsing and loading.""" from __future__ import annotations diff --git a/src/exposed/logging.py b/src/exposed/logging.py index cdabd76..efffbca 100644 --- a/src/exposed/logging.py +++ b/src/exposed/logging.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """:py:class:`logging.Logger` setup and stream separation""" import logging diff --git a/src/exposed/rc.py b/src/exposed/rc.py index deab6ec..f0b1e29 100644 --- a/src/exposed/rc.py +++ b/src/exposed/rc.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + """Implements a global configuration system setup and readout.""" from __future__ import annotations diff --git a/tests/conftest.py b/tests/conftest.py index 5144e09..0018c01 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import contextlib import io import pathlib diff --git a/tests/test_click.py b/tests/test_click.py index e47b4bb..b25c957 100644 --- a/tests/test_click.py +++ b/tests/test_click.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import difflib import logging diff --git a/tests/test_config.py b/tests/test_config.py index 9495832..7f191be 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import filecmp import io diff --git a/tests/test_logging.py b/tests/test_logging.py index 1f4df73..007fafa 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import io import logging diff --git a/tests/test_rc.py b/tests/test_rc.py index d25ea27..02f7aab 100644 --- a/tests/test_rc.py +++ b/tests/test_rc.py @@ -1,3 +1,7 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: BSD-3-Clause + import filecmp import logging import os -- GitLab From 32499b489a1c486ea39a241e780b452dc6f5fc55 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Tue, 22 Nov 2022 11:17:17 +0100 Subject: [PATCH 3/3] [manifest] Include licenses with source distribution --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1064d23..89b414a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,6 @@ # # SPDX-License-Identifier: BSD-3-Clause -include LICENSE README.md +include LICENSES/*.txt recursive-include doc *.rst *.txt *.py *.ico *.png recursive-include tests/data *.py *.cfg -- GitLab