Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate 'multiple' and 'collection' subcommands #505

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/505-deprecate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deprecated_features:
- "The ``multiple`` and ``collection`` subcommands are deprecated and will be removed soon. They were never used to our knowledge except in the exploratory phase before the first Ansible 2.10 releases, have no test coverage, and might not even work at all. If you are actively using them and are interested in keeping them, please create an issue in the antsibull repository as soon as possible (https://github.com/ansible-community/antsibull/pull/505)."
8 changes: 8 additions & 0 deletions src/antsibull/build_ansible_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import os.path
import shutil
import sys
import tempfile
from collections.abc import Collection, Mapping
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -678,6 +679,13 @@ async def make_collection_dists(dest_dir: str, collection_dirs: list[str]) -> No
def build_multiple_command() -> int:
app_ctx = app_context.app_ctx.get()

print(
'DEPRECATION WARNING: The `multiple` subcommand is deprecated and will be removed soon.'
' If you are actively using this subcommand and are interested in keeping it, please'
' create an issue in the antsibull repository as soon as possible.',
file=sys.stderr,
)

build_filename = os.path.join(app_ctx.extra['data_dir'], app_ctx.extra['build_file'])
build_file = BuildFile(build_filename)
build_ansible_version, ansible_core_version, deps = build_file.parse()
Expand Down
9 changes: 9 additions & 0 deletions src/antsibull/build_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import json
import os.path
import sys
import tempfile

import sh
Expand All @@ -22,6 +23,14 @@

def build_collection_command():
app_ctx = app_context.app_ctx.get()

print(
'DEPRECATION WARNING: The `collection` subcommand is deprecated and will be removed soon.'
' If you are actively using this subcommand and are interested in keeping it, please'
' create an issue in the antsibull repository as soon as possible.',
file=sys.stderr,
)

with tempfile.TemporaryDirectory() as working_dir:
collection_dir = os.path.join(working_dir, 'community', 'ansible')

Expand Down