Skip to content

Commit

Permalink
feat!: deprecate enable-manifest and manifest-image-information (#4618)
Browse files Browse the repository at this point in the history
`--enable-manifest` and `--manifest-image-information` no longer
supported in core24.
  • Loading branch information
syu-w authored Mar 4, 2024
1 parent 029100c commit e426d07
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
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

0 comments on commit e426d07

Please sign in to comment.