From ce000407da6163f06e1890e28fa7c19e878e208e Mon Sep 17 00:00:00 2001 From: Carmen Bianca Bakker Date: Sat, 22 Jun 2019 11:36:15 +0200 Subject: [PATCH] Make the source tarball REUSE-compliant This was a bit of a challenge, but _kind of_ works. --- .reuse/dep5 | 14 +++++++++++--- MANIFEST.in | 1 + Makefile | 10 ++++++---- docs/authors.rst | 5 +++++ docs/history.rst | 5 +++++ docs/index.rst | 5 +++++ docs/readme.rst | 5 +++++ src/reuse/project.py | 4 ++-- 8 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index 084d2b3ed..27300e56f 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,14 +3,22 @@ Upstream-Name: reuse Upstream-Contact: Carmen Bianca Bakker Source: https://github.com/fsfe/reuse-tool -Files: .bumpversion.cfg +Files: .bumpversion.cfg setup.cfg Copyright: 2017-2019 Free Software Foundation Europe e.v. License: GPL-3.0-or-later -Files: docs/*.rst -Copyright: 2017-2018 Free Software Foundation Europe e.V. +Files: docs/reuse*.rst +Copyright: 2017-2019 Free Software Foundation Europe e.V. +License: CC-BY-SA-4.0 + +Files: docs/modules.rst +Copyright: 2017-2019 Free Software Foundation Europe e.V. License: CC-BY-SA-4.0 Files: tests/resources/* Copyright: 2017-2019 Free Software Foundation Europe e.V. License: GPL-3.0-or-later + +Files: src/fsfe_reuse.egg-info/* +Copyright: 2017-2019 Free Software Foundation Europe e.V. +License: GPL-3.0-or-later diff --git a/MANIFEST.in b/MANIFEST.in index 72dd64da1..ca3dcf398 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,6 +8,7 @@ include CHANGELOG.rst include Makefile include tox.ini include requirements.txt +include .reuse/dep5 recursive-include LICENSES * recursive-include docs * diff --git a/Makefile b/Makefile index d5ad682aa..5d0f7ae28 100644 --- a/Makefile +++ b/Makefile @@ -42,8 +42,6 @@ clean-docs: ## remove docs build artifacts -$(MAKE) -C docs clean rm -f docs/reuse*.rst rm -f docs/modules.rst - rm -f docs/history.md - rm -f docs/readme.md .PHONY: lint lint: ## check with pylint @@ -59,8 +57,12 @@ black: ## format with black black . .PHONY: reuse -reuse: ## check with self +reuse: dist ## check with self reuse lint + tar -xf dist/fsfe-reuse*.tar.gz -C dist/ + # This prevents the linter from using the project root as root. + git init dist/fsfe-reuse*/ + cd dist/fsfe-reuse*/; reuse lint .PHONY: test test: ## run tests quickly @@ -82,7 +84,7 @@ tox: ## run all tests against multiple versions of Python tox .PHONY: dist -dist: clean _pre-docs ## builds source and wheel package +dist: clean-build clean-pyc clean-docs _pre-docs ## builds source and wheel package python setup.py sdist python setup.py bdist_wheel ls -l dist diff --git a/docs/authors.rst b/docs/authors.rst index e122f914a..b3b1a0355 100644 --- a/docs/authors.rst +++ b/docs/authors.rst @@ -1 +1,6 @@ +.. + SPDX-Copyright: 2017-2018 Free Software Foundation Europe e.V. + + SPDX-License-Identifier: CC-BY-SA-4.0 + .. include:: ../AUTHORS.rst diff --git a/docs/history.rst b/docs/history.rst index 565b0521d..01e450064 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -1 +1,6 @@ +.. + SPDX-Copyright: 2017-2018 Free Software Foundation Europe e.V. + + SPDX-License-Identifier: CC-BY-SA-4.0 + .. include:: ../CHANGELOG.rst diff --git a/docs/index.rst b/docs/index.rst index 1c5c2c16e..dac699423 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,3 +1,8 @@ +.. + SPDX-Copyright: 2017-2018 Free Software Foundation Europe e.V. + + SPDX-License-Identifier: CC-BY-SA-4.0 + .. reuse documentation master file, created by sphinx-quickstart on Wed Nov 1 14:41:46 2017. You can adapt this file completely to your liking, but it should at least diff --git a/docs/readme.rst b/docs/readme.rst index 72a335581..65c15fe7b 100644 --- a/docs/readme.rst +++ b/docs/readme.rst @@ -1 +1,6 @@ +.. + SPDX-Copyright: 2017-2018 Free Software Foundation Europe e.V. + + SPDX-License-Identifier: CC-BY-SA-4.0 + .. include:: ../README.rst diff --git a/src/reuse/project.py b/src/reuse/project.py index 98aa6c2a4..385a814d1 100644 --- a/src/reuse/project.py +++ b/src/reuse/project.py @@ -98,7 +98,7 @@ def all_files(self, directory: PathLike = None) -> Iterator[Path]: _LOGGER.debug("ignoring %s", root / file_) continue - _LOGGER.debug(_("yielding %s"), file_) + _LOGGER.debug(_("yielding %s"), root / file_) yield root / file_ def spdx_info_of(self, path: PathLike) -> SpdxInfo: @@ -249,7 +249,7 @@ def _licenses(self) -> Dict[str, Path]: continue path = self._relative_from_root(path) - _LOGGER.debug("searching %s for license tags", path) + _LOGGER.debug(_("determining identifier of %s"), path) try: identifier = self._identifier_of_license(path)