diff --git a/.github/workflows/antsibull-build.yml b/.github/workflows/antsibull-build.yml
index 4806e824..238d19a9 100644
--- a/.github/workflows/antsibull-build.yml
+++ b/.github/workflows/antsibull-build.yml
@@ -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:
diff --git a/.github/workflows/antsibull-lint.yml b/.github/workflows/antsibull-lint.yml
index 0d4b28a2..2018af92 100644
--- a/.github/workflows/antsibull-lint.yml
+++ b/.github/workflows/antsibull-lint.yml
@@ -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:
diff --git a/.github/workflows/build-dumb-pypi.yml b/.github/workflows/build-dumb-pypi.yml
index 9c2d2eef..46a026ef 100644
--- a/.github/workflows/build-dumb-pypi.yml
+++ b/.github/workflows/build-dumb-pypi.yml
@@ -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:
diff --git a/.github/workflows/pythonlinters.yml b/.github/workflows/pythonlinters.yml
index b8224a9a..0f10853f 100644
--- a/.github/workflows/pythonlinters.yml
+++ b/.github/workflows/pythonlinters.yml
@@ -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
diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml
index 4a6e6ab2..3088673d 100644
--- a/.github/workflows/pythontests.yml
+++ b/.github/workflows/pythontests.yml
@@ -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
diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml
new file mode 100644
index 00000000..fa58be25
--- /dev/null
+++ b/.github/workflows/reuse.yml
@@ -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
diff --git a/.gitignore b/.gitignore
index c18b0357..b4aaeb15 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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]
diff --git a/.mypy.ini b/.mypy.ini
index de2efb1e..b5aaf808 100644
--- a/.mypy.ini
+++ b/.mypy.ini
@@ -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.*]
diff --git a/.pylintrc.automated b/.pylintrc.automated
index fd17111c..95e10f98 100644
--- a/.pylintrc.automated
+++ b/.pylintrc.automated
@@ -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
diff --git a/CHANGELOG.rst.license b/CHANGELOG.rst.license
new file mode 100644
index 00000000..5e8ef9c1
--- /dev/null
+++ b/CHANGELOG.rst.license
@@ -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
diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt
new file mode 120000
index 00000000..ea5b6064
--- /dev/null
+++ b/LICENSES/GPL-3.0-or-later.txt
@@ -0,0 +1 @@
+../LICENSE
\ No newline at end of file
diff --git a/README.md b/README.md
index 8b3f2c88..7f7eb867 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
+
+
# antsibull -- Ansible Build Scripts
[](https://github.com/ansible-community/antsibull/actions?query=workflow%3A%22Python+linting%22+branch%3Amain)
[](https://github.com/ansible-community/antsibull/actions?query=workflow%3A%22Python+testing%22+branch%3Amain)
diff --git a/changelogs/changelog.yaml.license b/changelogs/changelog.yaml.license
new file mode 100644
index 00000000..5e8ef9c1
--- /dev/null
+++ b/changelogs/changelog.yaml.license
@@ -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
diff --git a/changelogs/config.yaml b/changelogs/config.yaml
index 84cca368..2f683a51 100644
--- a/changelogs/config.yaml
+++ b/changelogs/config.yaml
@@ -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
diff --git a/changelogs/fragments/437-licenses.yml b/changelogs/fragments/437-licenses.yml
new file mode 100644
index 00000000..38b31b71
--- /dev/null
+++ b/changelogs/fragments/437-licenses.yml
@@ -0,0 +1,2 @@
+minor_changes:
+ - "The files in the source repository now follow the `REUSE Specification `_. The only exceptions are changelog fragments in ``changelogs/fragments/`` (https://github.com/ansible-community/antsibull/pull/437)."
diff --git a/codecov.yml b/codecov.yml
index ffc8c600..df2482ec 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -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:
diff --git a/docs/build-ansible.rst b/docs/build-ansible.rst
index e8df3d5b..a35f9dc2 100644
--- a/docs/build-ansible.rst
+++ b/docs/build-ansible.rst
@@ -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
********
diff --git a/docs/changelog.yaml-format.md b/docs/changelog.yaml-format.md
index ffc2a2e3..fb97f459 100644
--- a/docs/changelog.yaml-format.md
+++ b/docs/changelog.yaml-format.md
@@ -1,3 +1,9 @@
+
+
Changelog YAML Format
=====================
diff --git a/docs/schemas.rst b/docs/schemas.rst
index 9945d6e6..317dab87 100644
--- a/docs/schemas.rst
+++ b/docs/schemas.rst
@@ -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
diff --git a/lint-flake8.sh b/lint-flake8.sh
index 056e80de..5105854d 100755
--- a/lint-flake8.sh
+++ b/lint-flake8.sh
@@ -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 "$@"
diff --git a/lint-mypy.sh b/lint-mypy.sh
index 7a915671..8251ba66 100755
--- a/lint-mypy.sh
+++ b/lint-mypy.sh
@@ -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 "$@"
diff --git a/lint-pylint.sh b/lint-pylint.sh
index 40a7400c..5c1e534d 100755
--- a/lint-pylint.sh
+++ b/lint-pylint.sh
@@ -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 "$@"
diff --git a/lint-pyre.sh b/lint-pyre.sh
index 48aa095e..2f0bb65b 100755
--- a/lint-pyre.sh
+++ b/lint-pyre.sh
@@ -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))')
diff --git a/mypy.ini b/mypy.ini
index de2efb1e..b5aaf808 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -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.*]
diff --git a/playbooks/action_plugins/parse_ansible_runtime.py b/playbooks/action_plugins/parse_ansible_runtime.py
index d84d3773..d75142f0 100644
--- a/playbooks/action_plugins/parse_ansible_runtime.py
+++ b/playbooks/action_plugins/parse_ansible_runtime.py
@@ -1,5 +1,6 @@
# Copyright (C) 2021 David Moreau-Simard
-# 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
diff --git a/playbooks/build-single-release.yaml b/playbooks/build-single-release.yaml
index 490aa513..2c64e089 100644
--- a/playbooks/build-single-release.yaml
+++ b/playbooks/build-single-release.yaml
@@ -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
diff --git a/playbooks/nested-ansible-tests.yaml b/playbooks/nested-ansible-tests.yaml
index 971774ab..bf601b8b 100644
--- a/playbooks/nested-ansible-tests.yaml
+++ b/playbooks/nested-ansible-tests.yaml
@@ -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
diff --git a/pyproject.toml b/pyproject.toml
index e46fecac..cd993753 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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"
diff --git a/requirements.txt b/requirements.txt
index e7c7a859..aa0c0a4d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -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
diff --git a/roles/build-release/README.md b/roles/build-release/README.md
index efb3c200..7097a14d 100644
--- a/roles/build-release/README.md
+++ b/roles/build-release/README.md
@@ -1,3 +1,9 @@
+
+
## antsibull: build-release
An Ansible role that builds an Ansible release package with Antsibull and tests it.
diff --git a/roles/build-release/defaults/main.yaml b/roles/build-release/defaults/main.yaml
index f905bde4..0e4ec6ca 100644
--- a/roles/build-release/defaults/main.yaml
+++ b/roles/build-release/defaults/main.yaml
@@ -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
diff --git a/roles/build-release/meta/argument_specs.yml b/roles/build-release/meta/argument_specs.yml
index cd5f7bfd..6172a85f 100644
--- a/roles/build-release/meta/argument_specs.yml
+++ b/roles/build-release/meta/argument_specs.yml
@@ -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
diff --git a/roles/build-release/meta/main.yml b/roles/build-release/meta/main.yml
index 92de0f8d..5310254f 100644
--- a/roles/build-release/meta/main.yml
+++ b/roles/build-release/meta/main.yml
@@ -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
diff --git a/roles/build-release/tasks/build.yaml b/roles/build-release/tasks/build.yaml
index 79cde98a..c70af2ba 100644
--- a/roles/build-release/tasks/build.yaml
+++ b/roles/build-release/tasks/build.yaml
@@ -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"
diff --git a/roles/build-release/tasks/main.yaml b/roles/build-release/tasks/main.yaml
index 7636f9db..829ea79d 100644
--- a/roles/build-release/tasks/main.yaml
+++ b/roles/build-release/tasks/main.yaml
@@ -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
diff --git a/roles/build-release/tasks/setup.yaml b/roles/build-release/tasks/setup.yaml
index 3e829549..dba5760c 100644
--- a/roles/build-release/tasks/setup.yaml
+++ b/roles/build-release/tasks/setup.yaml
@@ -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 }}"
diff --git a/roles/build-release/tasks/tests.yaml b/roles/build-release/tasks/tests.yaml
index 7d720b01..a91a4c99 100644
--- a/roles/build-release/tasks/tests.yaml
+++ b/roles/build-release/tasks/tests.yaml
@@ -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 }}"
diff --git a/roles/build-release/test_plugins/version.py b/roles/build-release/test_plugins/version.py
index abbc5cc3..8a713256 100644
--- a/roles/build-release/test_plugins/version.py
+++ b/roles/build-release/test_plugins/version.py
@@ -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
diff --git a/roles/build-release/vars/main.yml b/roles/build-release/vars/main.yml
index c5b051f2..06a98178 100644
--- a/roles/build-release/vars/main.yml
+++ b/roles/build-release/vars/main.yml
@@ -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.
diff --git a/src/antsibull/__init__.py b/src/antsibull/__init__.py
index e69de29b..816be309 100644
--- a/src/antsibull/__init__.py
+++ b/src/antsibull/__init__.py
@@ -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
diff --git a/src/antsibull/build_ansible_commands.py b/src/antsibull/build_ansible_commands.py
index 60c2b9c1..64167093 100644
--- a/src/antsibull/build_ansible_commands.py
+++ b/src/antsibull/build_ansible_commands.py
@@ -1,7 +1,7 @@
# coding: utf-8
# Author: Toshio Kuratomi
-# License: GPLv3+
-# Copyright: Ansible Project, 2020
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
"""Build Ansible packages."""
import asyncio
diff --git a/src/antsibull/build_changelog.py b/src/antsibull/build_changelog.py
index bbe3111e..29553d30 100644
--- a/src/antsibull/build_changelog.py
+++ b/src/antsibull/build_changelog.py
@@ -1,8 +1,10 @@
# coding: utf-8
-# Author: Felix Fontein
+# Author: Felix Fontein
# Author: Toshio Kuratomi
-# 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
diff --git a/src/antsibull/build_collection.py b/src/antsibull/build_collection.py
index 0e1081cd..10171f13 100644
--- a/src/antsibull/build_collection.py
+++ b/src/antsibull/build_collection.py
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Toshio Kuratomi
-# 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
diff --git a/src/antsibull/changelog.py b/src/antsibull/changelog.py
index fae187a7..5469d989 100644
--- a/src/antsibull/changelog.py
+++ b/src/antsibull/changelog.py
@@ -1,8 +1,10 @@
# coding: utf-8
-# Author: Felix Fontein
+# Author: Felix Fontein
# Author: Toshio Kuratomi
-# 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
"""Changelog handling and processing code."""
import asyncio
diff --git a/src/antsibull/cli/__init__.py b/src/antsibull/cli/__init__.py
index 9153bc09..9ff36a31 100644
--- a/src/antsibull/cli/__init__.py
+++ b/src/antsibull/cli/__init__.py
@@ -1 +1,6 @@
+# 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
+
"""Entrypoints to scripts"""
diff --git a/src/antsibull/cli/antsibull_build.py b/src/antsibull/cli/antsibull_build.py
index 68280c74..34d105ca 100644
--- a/src/antsibull/cli/antsibull_build.py
+++ b/src/antsibull/cli/antsibull_build.py
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Toshio Kuratomi
-# 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
"""Entrypoint to the antsibull-build tool."""
import argparse
diff --git a/src/antsibull/cli/antsibull_lint.py b/src/antsibull/cli/antsibull_lint.py
index 810669a8..b86c15db 100644
--- a/src/antsibull/cli/antsibull_lint.py
+++ b/src/antsibull/cli/antsibull_lint.py
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Felix Fontein
-# 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
"""
Entrypoint to the antsibull-changelog script.
diff --git a/src/antsibull/data/README_md.txt.license b/src/antsibull/data/README_md.txt.license
new file mode 100644
index 00000000..5e8ef9c1
--- /dev/null
+++ b/src/antsibull/data/README_md.txt.license
@@ -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
diff --git a/src/antsibull/data/__init__.py b/src/antsibull/data/__init__.py
index e69de29b..816be309 100644
--- a/src/antsibull/data/__init__.py
+++ b/src/antsibull/data/__init__.py
@@ -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
diff --git a/src/antsibull/data/ansible-community.py.j2 b/src/antsibull/data/ansible-community.py.j2
index 6b98dcf5..bb45f1e9 100644
--- a/src/antsibull/data/ansible-community.py.j2
+++ b/src/antsibull/data/ansible-community.py.j2
@@ -1,8 +1,9 @@
#!/usr/bin/python
# coding: utf-8
# Author: Mario Lenz
-# License: GPLv3+
-# Copyright: Ansible Project, 2022
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2022
"""The ansible-community CLI program."""
import argparse
diff --git a/src/antsibull/data/ansible-readme.rst b/src/antsibull/data/ansible-readme.rst
index 9bc7973e..0684e457 100644
--- a/src/antsibull/data/ansible-readme.rst
+++ b/src/antsibull/data/ansible-readme.rst
@@ -1,3 +1,8 @@
+..
+ GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+ SPDX-FileCopyrightText: Ansible Project, 2020
+
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct| |Mailing Lists| |License|
*******
diff --git a/src/antsibull/data/ansible-release_py.j2 b/src/antsibull/data/ansible-release_py.j2
index a5ef031e..8c41ed64 100644
--- a/src/antsibull/data/ansible-release_py.j2
+++ b/src/antsibull/data/ansible-release_py.j2
@@ -1,5 +1,6 @@
-# Copyright: (c) 2021, Ansible Team
+# Copyright (c) 2021, Ansible Team
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
ansible_version = '{{ version }}'
diff --git a/src/antsibull/data/ansible-setup_py.j2 b/src/antsibull/data/ansible-setup_py.j2
index 4c881868..aef002e1 100644
--- a/src/antsibull/data/ansible-setup_py.j2
+++ b/src/antsibull/data/ansible-setup_py.j2
@@ -1,4 +1,7 @@
#!/usr/bin/python -tt
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
import os
import sys
diff --git a/src/antsibull/data/build-ansible.sh.j2 b/src/antsibull/data/build-ansible.sh.j2
index e1d5bf63..7b7f93b6 100644
--- a/src/antsibull/data/build-ansible.sh.j2
+++ b/src/antsibull/data/build-ansible.sh.j2
@@ -1,4 +1,8 @@
#!/bin/sh
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
+
set -e
VERSION="{{ version }}"
diff --git a/src/antsibull/data/collection-readme.j2 b/src/antsibull/data/collection-readme.j2
index 79e30f65..51aa8f27 100644
--- a/src/antsibull/data/collection-readme.j2
+++ b/src/antsibull/data/collection-readme.j2
@@ -1,3 +1,8 @@
+..
+ GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+ SPDX-FileCopyrightText: Ansible Project, 2020
+
This is the {{ collection_name }} Ansible collection.
You can install this using::
diff --git a/src/antsibull/data/collection-setup_py.j2 b/src/antsibull/data/collection-setup_py.j2
index 464a4e1a..754c668c 100644
--- a/src/antsibull/data/collection-setup_py.j2
+++ b/src/antsibull/data/collection-setup_py.j2
@@ -1,4 +1,7 @@
#!/usr/bin/python -tt
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
from setuptools import setup
diff --git a/src/antsibull/data/debian/changelog.j2 b/src/antsibull/data/debian/changelog.j2
index 4be0214c..92d98b28 100644
--- a/src/antsibull/data/debian/changelog.j2
+++ b/src/antsibull/data/debian/changelog.j2
@@ -1,3 +1,7 @@
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
+
ansible ({{ version }}-1) unstable; urgency=medium
* Ansible {{ version }} release
diff --git a/src/antsibull/data/debian/control.j2 b/src/antsibull/data/debian/control.j2
index 4f3cfa7f..a6c36635 100644
--- a/src/antsibull/data/debian/control.j2
+++ b/src/antsibull/data/debian/control.j2
@@ -1,3 +1,7 @@
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
+
Source: ansible
Section: admin
Priority: optional
diff --git a/src/antsibull/data/debian/copyright.license b/src/antsibull/data/debian/copyright.license
new file mode 100644
index 00000000..5e8ef9c1
--- /dev/null
+++ b/src/antsibull/data/debian/copyright.license
@@ -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
diff --git a/src/antsibull/data/debian/rules b/src/antsibull/data/debian/rules
index d960e324..6a8f68aa 100755
--- a/src/antsibull/data/debian/rules
+++ b/src/antsibull/data/debian/rules
@@ -1,4 +1,8 @@
#!/usr/bin/make -f
+# 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
+
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
diff --git a/src/antsibull/data/debian/rules.license b/src/antsibull/data/debian/rules.license
new file mode 100644
index 00000000..5e8ef9c1
--- /dev/null
+++ b/src/antsibull/data/debian/rules.license
@@ -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
diff --git a/src/antsibull/data/galaxy_yml.j2 b/src/antsibull/data/galaxy_yml.j2
index 2662e1a8..212afea3 100644
--- a/src/antsibull/data/galaxy_yml.j2
+++ b/src/antsibull/data/galaxy_yml.j2
@@ -1,3 +1,7 @@
+# GNU General Public License v3.0+ (see https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: Ansible Project, 2020
+
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
diff --git a/src/antsibull/data/gplv3.txt.license b/src/antsibull/data/gplv3.txt.license
new file mode 100644
index 00000000..5d4aebf2
--- /dev/null
+++ b/src/antsibull/data/gplv3.txt.license
@@ -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: 2007 Free Software Foundation, Inc.
diff --git a/src/antsibull/dep_closure.py b/src/antsibull/dep_closure.py
index 7dea0f15..14af1916 100644
--- a/src/antsibull/dep_closure.py
+++ b/src/antsibull/dep_closure.py
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Toshio Kuratomi
-# License: GPLv3+
-# Copyright: Ansible Project, 2021
+# 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, 2021
"""Check collection dependencies."""
import json
diff --git a/src/antsibull/new_ansible.py b/src/antsibull/new_ansible.py
index 9ebf29bc..576b8fe0 100644
--- a/src/antsibull/new_ansible.py
+++ b/src/antsibull/new_ansible.py
@@ -1,7 +1,9 @@
# coding: utf-8
# Author: Toshio Kuratomi
-# 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 command for creating a new major Ansible version."""
import asyncio
diff --git a/src/antsibull/utils/__init__.py b/src/antsibull/utils/__init__.py
index e69de29b..816be309 100644
--- a/src/antsibull/utils/__init__.py
+++ b/src/antsibull/utils/__init__.py
@@ -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
diff --git a/src/antsibull/utils/get_pkg_data.py b/src/antsibull/utils/get_pkg_data.py
index 830f5c74..5273311c 100644
--- a/src/antsibull/utils/get_pkg_data.py
+++ b/src/antsibull/utils/get_pkg_data.py
@@ -1,7 +1,9 @@
# Author: Felix Fontein
# Author: Toshio Kuratomi
-# 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
"""Helper to use pkgutil.get_data without having to check the return value."""
import pkgutil
diff --git a/stubs/ansible/__init__.pyi b/stubs/ansible/__init__.pyi
index e69de29b..ab309618 100644
--- a/stubs/ansible/__init__.pyi
+++ b/stubs/ansible/__init__.pyi
@@ -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
diff --git a/stubs/ansible/cli/__init__.pyi b/stubs/ansible/cli/__init__.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/cli/__init__.pyi
+++ b/stubs/ansible/cli/__init__.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/cli/arguments.pyi b/stubs/ansible/cli/arguments.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/cli/arguments.pyi
+++ b/stubs/ansible/cli/arguments.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/collections/list.pyi b/stubs/ansible/collections/list.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/collections/list.pyi
+++ b/stubs/ansible/collections/list.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/constants.pyi b/stubs/ansible/constants.pyi
index 141b666a..6e6df595 100644
--- a/stubs/ansible/constants.pyi
+++ b/stubs/ansible/constants.pyi
@@ -1,3 +1,7 @@
+# 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
+
from typing import Tuple
diff --git a/stubs/ansible/galaxy/collection.pyi b/stubs/ansible/galaxy/collection.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/galaxy/collection.pyi
+++ b/stubs/ansible/galaxy/collection.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/module_utils/_text.pyi b/stubs/ansible/module_utils/_text.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/module_utils/_text.pyi
+++ b/stubs/ansible/module_utils/_text.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/module_utils/common/json.pyi b/stubs/ansible/module_utils/common/json.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/module_utils/common/json.pyi
+++ b/stubs/ansible/module_utils/common/json.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/plugins/loader.pyi b/stubs/ansible/plugins/loader.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/plugins/loader.pyi
+++ b/stubs/ansible/plugins/loader.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/release.pyi b/stubs/ansible/release.pyi
index da6feb79..146ca79d 100644
--- a/stubs/ansible/release.pyi
+++ b/stubs/ansible/release.pyi
@@ -1,2 +1,6 @@
+# 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
+
__version__: str
__codename__: str
diff --git a/stubs/ansible/utils/collection_loader.pyi b/stubs/ansible/utils/collection_loader.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/utils/collection_loader.pyi
+++ b/stubs/ansible/utils/collection_loader.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/ansible/utils/plugin_docs.pyi b/stubs/ansible/utils/plugin_docs.pyi
index 4287ca86..ab309618 100644
--- a/stubs/ansible/utils/plugin_docs.pyi
+++ b/stubs/ansible/utils/plugin_docs.pyi
@@ -1 +1,3 @@
-#
\ No newline at end of file
+# 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
diff --git a/stubs/argcomplete.pyi b/stubs/argcomplete.pyi
index e12fcbc2..0e254a77 100644
--- a/stubs/argcomplete.pyi
+++ b/stubs/argcomplete.pyi
@@ -1,3 +1,7 @@
+# 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
+
import argparse
diff --git a/stubs/argparse.pyi b/stubs/argparse.pyi
deleted file mode 100644
index ec9ce24b..00000000
--- a/stubs/argparse.pyi
+++ /dev/null
@@ -1,450 +0,0 @@
-import sys
-from typing import (
- IO,
- Any,
- Callable,
- Dict,
- Generator,
- Iterable,
- List,
- NoReturn,
- Optional,
- Pattern,
- Protocol,
- Sequence,
- Tuple,
- Type,
- TypeVar,
- Union,
- overload,
-)
-
-_T = TypeVar("_T")
-_ActionT = TypeVar("_ActionT", bound=Action)
-_N = TypeVar("_N")
-
-ONE_OR_MORE: str
-OPTIONAL: str
-PARSER: str
-REMAINDER: str
-SUPPRESS: str
-ZERO_OR_MORE: str
-_UNRECOGNIZED_ARGS_ATTR: str # undocumented
-
-class ArgumentError(Exception):
- argument_name: Optional[str]
- message: str
- def __init__(self, argument: Optional[Action], message: str) -> None: ...
-
-# undocumented
-class _AttributeHolder:
- def _get_kwargs(self) -> List[Tuple[str, Any]]: ...
- def _get_args(self) -> List[Any]: ...
-
-# undocumented
-class _ActionsContainer:
- description: Optional[str]
- prefix_chars: str
- argument_default: Any
- conflict_handler: str
-
- _registries: Dict[str, Dict[Any, Any]]
- _actions: List[Action]
- _option_string_actions: Dict[str, Action]
- _action_groups: List[_ArgumentGroup]
- _mutually_exclusive_groups: List[_MutuallyExclusiveGroup]
- _defaults: Dict[str, Any]
- _negative_number_matcher: Pattern[str]
- _has_negative_number_optionals: List[bool]
- def __init__(self, description: Optional[str], prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ...
- def register(self, registry_name: str, value: Any, object: Any) -> None: ...
- def _registry_get(self, registry_name: str, value: Any, default: Any = ...) -> Any: ...
- def set_defaults(self, **kwargs: Any) -> None: ...
- def get_default(self, dest: str) -> Any: ...
- def add_argument(
- self,
- *name_or_flags: str,
- action: Union[str, Type[Action]] = ...,
- nargs: Union[int, str] = ...,
- const: Any = ...,
- default: Any = ...,
- type: Union[Callable[[str], _T], Callable[[str], _T], FileType] = ...,
- choices: Optional[Iterable[_T]] = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- dest: Optional[str] = ...,
- version: str = ...,
- **kwargs: Any,
- ) -> Action: ...
- def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ...
- def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ...
- def _add_action(self, action: _ActionT) -> _ActionT: ...
- def _remove_action(self, action: Action) -> None: ...
- def _add_container_actions(self, container: _ActionsContainer) -> None: ...
- def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> Dict[str, Any]: ...
- def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
- def _pop_action_class(self, kwargs: Any, default: Optional[Type[Action]] = ...) -> Type[Action]: ...
- def _get_handler(self) -> Callable[[Action, Iterable[Tuple[str, Action]]], Any]: ...
- def _check_conflict(self, action: Action) -> None: ...
- def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[str, Action]]) -> NoReturn: ...
- def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[str, Action]]) -> None: ...
-
-class _FormatterClass(Protocol):
- def __call__(self, prog: str) -> HelpFormatter: ...
-
-class ArgumentParser(_AttributeHolder, _ActionsContainer):
- prog: str
- usage: Optional[str]
- epilog: Optional[str]
- formatter_class: _FormatterClass
- fromfile_prefix_chars: Optional[str]
- add_help: bool
- allow_abbrev: bool
-
- # undocumented
- _positionals: _ArgumentGroup
- _optionals: _ArgumentGroup
- _subparsers: Optional[_ArgumentGroup]
-
- if sys.version_info >= (3, 9):
- def __init__(
- self,
- prog: Optional[str] = ...,
- usage: Optional[str] = ...,
- description: Optional[str] = ...,
- epilog: Optional[str] = ...,
- parents: Sequence[ArgumentParser] = ...,
- formatter_class: _FormatterClass = ...,
- prefix_chars: str = ...,
- fromfile_prefix_chars: Optional[str] = ...,
- argument_default: Any = ...,
- conflict_handler: str = ...,
- add_help: bool = ...,
- allow_abbrev: bool = ...,
- exit_on_error: bool = ...,
- ) -> None: ...
- else:
- def __init__(
- self,
- prog: Optional[str] = ...,
- usage: Optional[str] = ...,
- description: Optional[str] = ...,
- epilog: Optional[str] = ...,
- parents: Sequence[ArgumentParser] = ...,
- formatter_class: _FormatterClass = ...,
- prefix_chars: str = ...,
- fromfile_prefix_chars: Optional[str] = ...,
- argument_default: Any = ...,
- conflict_handler: str = ...,
- add_help: bool = ...,
- allow_abbrev: bool = ...,
- ) -> None: ...
- # The type-ignores in these overloads should be temporary. See:
- # https://github.com/python/typeshed/pull/2643#issuecomment-442280277
- @overload
- def parse_args(self, args: Optional[Sequence[str]] = ...) -> Namespace: ...
- @overload
- def parse_args(self, args: Optional[Sequence[str]], namespace: None) -> Namespace: ... # type: ignore
- @overload
- def parse_args(self, args: Optional[Sequence[str]], namespace: _N) -> _N: ...
- @overload
- def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore
- @overload
- def parse_args(self, *, namespace: _N) -> _N: ...
- if sys.version_info >= (3, 7):
- def add_subparsers(
- self,
- *,
- title: str = ...,
- description: Optional[str] = ...,
- prog: str = ...,
- parser_class: Type[ArgumentParser] = ...,
- action: Type[Action] = ...,
- option_string: str = ...,
- dest: Optional[str] = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[str] = ...,
- ) -> _SubParsersAction: ...
- else:
- def add_subparsers(
- self,
- *,
- title: str = ...,
- description: Optional[str] = ...,
- prog: str = ...,
- parser_class: Type[ArgumentParser] = ...,
- action: Type[Action] = ...,
- option_string: str = ...,
- dest: Optional[str] = ...,
- help: Optional[str] = ...,
- metavar: Optional[str] = ...,
- ) -> _SubParsersAction: ...
- def print_usage(self, file: Optional[IO[str]] = ...) -> None: ...
- def print_help(self, file: Optional[IO[str]] = ...) -> None: ...
- def format_usage(self) -> str: ...
- def format_help(self) -> str: ...
- def parse_known_args(
- self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...
- ) -> Tuple[Namespace, List[str]]: ...
- def convert_arg_line_to_args(self, arg_line: str) -> List[str]: ...
- def exit(self, status: int = ..., message: Optional[str] = ...) -> NoReturn: ...
- def error(self, message: str) -> NoReturn: ...
- if sys.version_info >= (3, 7):
- def parse_intermixed_args(
- self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...
- ) -> Namespace: ...
- def parse_known_intermixed_args(
- self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...
- ) -> Tuple[Namespace, List[str]]: ...
- # undocumented
- def _get_optional_actions(self) -> List[Action]: ...
- def _get_positional_actions(self) -> List[Action]: ...
- def _parse_known_args(self, arg_strings: List[str], namespace: Namespace) -> Tuple[Namespace, List[str]]: ...
- def _read_args_from_files(self, arg_strings: List[str]) -> List[str]: ...
- def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
- def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> List[int]: ...
- def _parse_optional(self, arg_string: str) -> Optional[Tuple[Optional[Action], str, Optional[str]]]: ...
- def _get_option_tuples(self, option_string: str) -> List[Tuple[Action, str, Optional[str]]]: ...
- def _get_nargs_pattern(self, action: Action) -> str: ...
- def _get_values(self, action: Action, arg_strings: List[str]) -> Any: ...
- def _get_value(self, action: Action, arg_string: str) -> Any: ...
- def _check_value(self, action: Action, value: Any) -> None: ...
- def _get_formatter(self) -> HelpFormatter: ...
- def _print_message(self, message: str, file: Optional[IO[str]] = ...) -> None: ...
-
-class HelpFormatter:
- # undocumented
- _prog: str
- _indent_increment: int
- _max_help_position: int
- _width: int
- _current_indent: int
- _level: int
- _action_max_length: int
- _root_section: Any
- _current_section: Any
- _whitespace_matcher: Pattern[str]
- _long_break_matcher: Pattern[str]
- _Section: Type[Any] # Nested class
- def __init__(
- self, prog: str, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ...
- ) -> None: ...
- def _indent(self) -> None: ...
- def _dedent(self) -> None: ...
- def _add_item(self, func: Callable[..., str], args: Iterable[Any]) -> None: ...
- def start_section(self, heading: Optional[str]) -> None: ...
- def end_section(self) -> None: ...
- def add_text(self, text: Optional[str]) -> None: ...
- def add_usage(
- self, usage: Optional[str], actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[str] = ...
- ) -> None: ...
- def add_argument(self, action: Action) -> None: ...
- def add_arguments(self, actions: Iterable[Action]) -> None: ...
- def format_help(self) -> str: ...
- def _join_parts(self, part_strings: Iterable[str]) -> str: ...
- def _format_usage(
- self, usage: str, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[str]
- ) -> str: ...
- def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> str: ...
- def _format_text(self, text: str) -> str: ...
- def _format_action(self, action: Action) -> str: ...
- def _format_action_invocation(self, action: Action) -> str: ...
- def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], Tuple[str, ...]]: ...
- def _format_args(self, action: Action, default_metavar: str) -> str: ...
- def _expand_help(self, action: Action) -> str: ...
- def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
- def _split_lines(self, text: str, width: int) -> List[str]: ...
- def _fill_text(self, text: str, width: int, indent: str) -> str: ...
- def _get_help_string(self, action: Action) -> Optional[str]: ...
- def _get_default_metavar_for_optional(self, action: Action) -> str: ...
- def _get_default_metavar_for_positional(self, action: Action) -> str: ...
-
-class RawDescriptionHelpFormatter(HelpFormatter): ...
-class RawTextHelpFormatter(RawDescriptionHelpFormatter): ...
-class ArgumentDefaultsHelpFormatter(HelpFormatter): ...
-class MetavarTypeHelpFormatter(HelpFormatter): ...
-
-class Action(_AttributeHolder):
- option_strings: Sequence[str]
- dest: str
- nargs: Optional[Union[int, str]]
- const: Any
- default: Any
- type: Union[Callable[[str], Any], FileType, None]
- choices: Optional[Iterable[Any]]
- required: bool
- help: Optional[str]
- metavar: Optional[Union[str, Tuple[str, ...]]]
- def __init__(
- self,
- option_strings: Sequence[str],
- dest: str,
- nargs: Optional[Union[int, str]] = ...,
- const: Optional[_T] = ...,
- default: Union[_T, str, None] = ...,
- type: Optional[Union[Callable[[str], _T], Callable[[str], _T], FileType]] = ...,
- choices: Optional[Iterable[_T]] = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
- def __call__(
- self,
- parser: ArgumentParser,
- namespace: Namespace,
- values: Union[str, Sequence[Any], None],
- option_string: Optional[str] = ...,
- ) -> None: ...
- if sys.version_info >= (3, 9):
- def format_usage(self) -> str: ...
-
-if sys.version_info >= (3, 9):
- class BooleanOptionalAction(Action):
- def __init__(
- self,
- option_strings: Sequence[str],
- dest: str,
- default: Union[_T, str, None] = ...,
- type: Optional[Union[Callable[[str], _T], Callable[[str], _T], FileType]] = ...,
- choices: Optional[Iterable[_T]] = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
-
-class Namespace(_AttributeHolder):
- def __init__(self, **kwargs: Any) -> None: ...
- def __getattr__(self, name: str) -> Any: ...
- def __setattr__(self, name: str, value: Any) -> None: ...
- def __contains__(self, key: str) -> bool: ...
-
-class FileType:
- # undocumented
- _mode: str
- _bufsize: int
- _encoding: Optional[str]
- _errors: Optional[str]
- def __init__(
- self, mode: str = ..., bufsize: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...
- ) -> None: ...
- def __call__(self, string: str) -> IO[Any]: ...
-
-# undocumented
-class _ArgumentGroup(_ActionsContainer):
- title: Optional[str]
- _group_actions: List[Action]
- def __init__(
- self, container: _ActionsContainer, title: Optional[str] = ..., description: Optional[str] = ..., **kwargs: Any
- ) -> None: ...
-
-# undocumented
-class _MutuallyExclusiveGroup(_ArgumentGroup):
- required: bool
- _container: _ActionsContainer
- def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ...
-
-# undocumented
-class _StoreAction(Action): ...
-
-# undocumented
-class _StoreConstAction(Action):
- def __init__(
- self,
- option_strings: Sequence[str],
- dest: str,
- const: Any,
- default: Any = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
-
-# undocumented
-class _StoreTrueAction(_StoreConstAction):
- def __init__(
- self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: Optional[str] = ...
- ) -> None: ...
-
-# undocumented
-class _StoreFalseAction(_StoreConstAction):
- def __init__(
- self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: Optional[str] = ...
- ) -> None: ...
-
-# undocumented
-class _AppendAction(Action): ...
-
-# undocumented
-class _AppendConstAction(Action):
- def __init__(
- self,
- option_strings: Sequence[str],
- dest: str,
- const: Any,
- default: Any = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
-
-# undocumented
-class _CountAction(Action):
- def __init__(
- self, option_strings: Sequence[str], dest: str, default: Any = ..., required: bool = ..., help: Optional[str] = ...
- ) -> None: ...
-
-# undocumented
-class _HelpAction(Action):
- def __init__(self, option_strings: Sequence[str], dest: str = ..., default: str = ..., help: Optional[str] = ...) -> None: ...
-
-# undocumented
-class _VersionAction(Action):
- version: Optional[str]
- def __init__(
- self, option_strings: Sequence[str], version: Optional[str] = ..., dest: str = ..., default: str = ..., help: str = ...
- ) -> None: ...
-
-# undocumented
-class _SubParsersAction(Action):
- _ChoicesPseudoAction: Type[Any] # nested class
- _prog_prefix: str
- _parser_class: Type[ArgumentParser]
- _name_parser_map: Dict[str, ArgumentParser]
- choices: Dict[str, ArgumentParser]
- _choices_actions: List[Action]
- if sys.version_info >= (3, 7):
- def __init__(
- self,
- option_strings: Sequence[str],
- prog: str,
- parser_class: Type[ArgumentParser],
- dest: str = ...,
- required: bool = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
- else:
- def __init__(
- self,
- option_strings: Sequence[str],
- prog: str,
- parser_class: Type[ArgumentParser],
- dest: str = ...,
- help: Optional[str] = ...,
- metavar: Optional[Union[str, Tuple[str, ...]]] = ...,
- ) -> None: ...
- # TODO: Type keyword args properly.
- def add_parser(self, name: str, **kwargs: Any) -> ArgumentParser: ...
- def _get_subactions(self) -> List[Action]: ...
-
-# undocumented
-class ArgumentTypeError(Exception): ...
-
-if sys.version_info < (3, 7):
- # undocumented
- def _ensure_value(namespace: Namespace, name: str, value: Any) -> Any: ...
-
-# undocumented
-def _get_action_name(argument: Optional[Action]) -> Optional[str]: ...
diff --git a/stubs/rstcheck.pyi b/stubs/rstcheck.pyi
index 00e4b273..5c1d4dc8 100644
--- a/stubs/rstcheck.pyi
+++ b/stubs/rstcheck.pyi
@@ -1,3 +1,7 @@
+# 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
+
import docutils.utils
from typing import List, Tuple, Union
diff --git a/test-pytest.sh b/test-pytest.sh
index bab4f446..88007c1c 100755
--- a/test-pytest.sh
+++ b/test-pytest.sh
@@ -1,4 +1,8 @@
#!/bin/sh
+# 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
PYTHONPATH=src poetry run python -W 'ignore:"@coroutine" decorator is deprecated::asynctest.case' \
-m pytest --cov-branch --cov=antsibull --cov-report term-missing -vv tests "$@"
diff --git a/tests/test_dummy.py b/tests/test_dummy.py
index 9d565bbf..12cb3719 100644
--- a/tests/test_dummy.py
+++ b/tests/test_dummy.py
@@ -1,3 +1,7 @@
+# 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
+
# This file is here so that pytest won't complain that it cannot find tests.
# Remove once we have actual tests.