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

feat!: deprecate enable-manifest and manifest-image-information #4618

Merged
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
8 changes: 4 additions & 4 deletions snapcraft/commands/core22/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ def fill_parser(self, parser: "argparse.ArgumentParser") -> None:
help="Shell into the environment if the build fails",
)
parser.add_argument(
"--enable-manifest",
"--enable-manifest", # Deprecated and removed in core24
action="store_true",
default=utils.strtobool(os.getenv("SNAPCRAFT_BUILD_INFO", "n")),
help="Generate snap manifest",
help=argparse.SUPPRESS,
)
parser.add_argument(
"--manifest-image-information",
"--manifest-image-information", # Deprecated and removed in core24
type=str,
metavar="image-info",
default=os.getenv("SNAPCRAFT_IMAGE_INFO"),
help="Set snap manifest image-info",
help=argparse.SUPPRESS,
)
parser.add_argument(
"--bind-ssh",
Expand Down
4 changes: 0 additions & 4 deletions snapcraft/commands/core22/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,5 @@ def _load_lint_filters(self, project: Optional[models.Project]) -> models.Lint:
"Not loading lint filters from 'snapcraft.yaml' because the file "
"does not exist inside the snap file."
)
emit.verbose(
"To include 'snapcraft.yaml' in a snap file, use the parameter "
"'--enable-manifest' when building the snap."
)

return lint_config
12 changes: 12 additions & 0 deletions snapcraft/parts/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ def _generate_metadata(
emit.progress("Generated snap metadata", permanent=True)

if parsed_args.enable_manifest:
emit.progress(
"'--enable-manifest' is deprecated, and will be removed in core24.",
permanent=True,
)
_generate_manifest(
project,
lifecycle=lifecycle,
Expand Down Expand Up @@ -414,9 +418,17 @@ def _run_in_provider( # noqa PLR0915

if getattr(parsed_args, "enable_manifest", False):
cmd.append("--enable-manifest")
emit.progress(
"'--enable-manifest' is deprecated, and will be removed in core24.",
permanent=True,
)
image_information = getattr(parsed_args, "manifest_image_information", None)
if image_information:
cmd.extend(["--manifest-image-information", image_information])
emit.progress(
"'--manifest-image-information' is deprecated, and will be removed in core24.",
permanent=True,
)

cmd.append("--build-for")
cmd.append(project.get_build_for())
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/commands/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,6 @@ def test_lint_managed_mode_without_snapcraft_yaml(
"Not loading lint filters from 'snapcraft.yaml' because the file does "
"not exist inside the snap file.",
),
call(
"verbose",
"To include 'snapcraft.yaml' in a snap file, use the parameter "
"'--enable-manifest' when building the snap.",
),
]
)

Expand Down
Loading