Skip to content

Commit

Permalink
Follow REUSE specification (#437)
Browse files Browse the repository at this point in the history
* Follow REUSE specification.

* Add linting.

* Add changelog fragment.

* Remove redundant license identifiers.

* Fix my email.

* Correctly attribute stubs/argparse.pyi.

* Put copyright/license statements into templated files as well.

* Remove unnecessary type stub.

* Include copyright notice in debian's control file.

* Also apply change to Debian changelog.

* Normalize copyright headers.

* Remove duplicated copyright statement.
  • Loading branch information
felixfontein authored Jul 31, 2022
1 parent 41a0bd8 commit 11de032
Show file tree
Hide file tree
Showing 84 changed files with 352 additions and 483 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/antsibull-build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

name: antsibull-build tests

on:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/antsibull-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

name: Test antsibull-lint subcommands

on:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-dumb-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

name: 👷 dumb PyPI on GH pages

on:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pythonlinters.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# This workflow will install Python 3.9 and other dependencies to lint the code.
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pythontests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# This workflow will install a variety of Python versions and other
# dependencies to run tests. For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

name: Verify REUSE

on:
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Friday at 06:00 UTC)
schedule:
- cron: '0 6 * * 5'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
pip install reuse
- name: Remove changelog fragments for REUSE compliance check
run: |
rm -fv changelogs/fragments/*.yml
- name: Check REUSE compliance
run: |
reuse lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 4 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

[mypy]

[mypy-sh.*]
Expand Down
4 changes: 4 additions & 0 deletions .pylintrc.automated
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

[MASTER]

# A comma-separated list of package or module names from where C extensions may
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Ansible Project, 2020
1 change: 1 addition & 0 deletions LICENSES/GPL-3.0-or-later.txt
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
-->

# antsibull -- Ansible Build Scripts
[![Python linting badge](https://github.com/ansible-community/antsibull/workflows/Python%20linting/badge.svg?event=push&branch=main)](https://github.com/ansible-community/antsibull/actions?query=workflow%3A%22Python+linting%22+branch%3Amain)
[![Python testing badge](https://github.com/ansible-community/antsibull/workflows/Python%20testing/badge.svg?event=push&branch=main)](https://github.com/ansible-community/antsibull/actions?query=workflow%3A%22Python+testing%22+branch%3Amain)
Expand Down
3 changes: 3 additions & 0 deletions changelogs/changelog.yaml.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Ansible Project, 2020
5 changes: 5 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/437-licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "The files in the source repository now follow the `REUSE Specification <https://reuse.software/spec/>`_. The only exceptions are changelog fragments in ``changelogs/fragments/`` (https://github.com/ansible-community/antsibull/pull/437)."
5 changes: 5 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

comment: false
coverage:
status:
Expand Down
5 changes: 5 additions & 0 deletions docs/build-ansible.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
..
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
********
Overview
********
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.yaml-format.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
-->

Changelog YAML Format
=====================

Expand Down
5 changes: 5 additions & 0 deletions docs/schemas.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
..
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
.. automodule:: antsibull.schemas.docs.base

There is a dictionary named ANSIBLE_DOC_SCHEMAS to allow you easier access to these
Expand Down
4 changes: 4 additions & 0 deletions lint-flake8.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

set -e
poetry run flake8 src/antsibull --count --max-complexity=10 --max-line-length=100 --statistics "$@"
4 changes: 4 additions & 0 deletions lint-mypy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

set -e
MYPYPATH=stubs/ poetry run mypy src/antsibull "$@"
4 changes: 4 additions & 0 deletions lint-pylint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

set -e
poetry run pylint --rcfile .pylintrc.automated src/antsibull "$@"
4 changes: 4 additions & 0 deletions lint-pyre.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

set -e

PURELIB=$(poetry run python -c 'from distutils.sysconfig import get_python_lib;print(get_python_lib(0))')
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

[mypy]

[mypy-sh.*]
Expand Down
3 changes: 2 additions & 1 deletion playbooks/action_plugins/parse_ansible_runtime.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (C) 2021 David Moreau-Simard <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

import os
import yaml
Expand Down
4 changes: 4 additions & 0 deletions playbooks/build-single-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Build a single Ansible release
hosts: localhost
gather_facts: no
Expand Down
4 changes: 4 additions & 0 deletions playbooks/nested-ansible-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# These tests are meant to be run by another Ansible (i.e, the one built with build-single-release.yaml)
- name: Run nested Ansible tests
hosts: localhost
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

[build-system]
requires = ["poetry-core>=1.0.7"]
build-backend = "poetry.core.masonry.api"
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

aiofiles
aiohttp>=3.0.0
jinja2
Expand Down
6 changes: 6 additions & 0 deletions roles/build-release/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
Copyright (c) Ansible Project
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
-->

## antsibull: build-release

An Ansible role that builds an Ansible release package with Antsibull and tests it.
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# The command to run `antsibull-build`
antsibull_build_command: antsibull-build

Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

argument_specs:
main:
short_description: Build Ansible release package and test it
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

galaxy_info:
role_name: build-release
author: David Moreau Simard
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/tasks/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Set expected path to deps file, build file, and release archive
ansible.builtin.set_fact:
_deps_file: "ansible-{{ antsibull_ansible_version }}.deps"
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- include_tasks: setup.yaml
- include_tasks: build.yaml
- include_tasks: tests.yaml
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/tasks/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Ensure the sdist directory exists
ansible.builtin.file:
name: "{{ antsibull_sdist_dir }}"
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/tasks/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Clean up virtualenv if necessary
ansible.builtin.file:
path: "{{ antsibull_ansible_venv }}"
Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/test_plugins/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

Expand Down
4 changes: 4 additions & 0 deletions roles/build-release/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# Note: the value is either _ansible_base_version or _ansible_core_version depending on the version
# ex: https://github.com/ansible-community/ansible-build-data/blob/main/4/ansible-4.4.0.deps
# Variables that start with `_` are intermediate variables that are `register`ed in the playbook.
Expand Down
4 changes: 4 additions & 0 deletions src/antsibull/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or
# https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Ansible Project, 2020
4 changes: 2 additions & 2 deletions src/antsibull/build_ansible_commands.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
# Author: Toshio Kuratomi <[email protected]>
# License: GPLv3+
# Copyright: Ansible Project, 2020
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Ansible Project, 2020
"""Build Ansible packages."""

import asyncio
Expand Down
8 changes: 5 additions & 3 deletions src/antsibull/build_changelog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# coding: utf-8
# Author: Felix Fontein <[email protected]>
# Author: Felix Fontein <[email protected]>
# Author: Toshio Kuratomi <[email protected]>
# License: GPLv3+
# Copyright: Ansible Project, 2020
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or
# https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Ansible Project, 2020
"""Build Ansible changelog and porting guide."""

import os
Expand Down
6 changes: 4 additions & 2 deletions src/antsibull/build_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Toshio Kuratomi <[email protected]>
# License: GPLv3+
# Copyright: Ansible Project, 2020
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or
# https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Ansible Project, 2020
"""Build collection that collects all collections included in Ansible."""

import json
Expand Down
Loading

0 comments on commit 11de032

Please sign in to comment.