Skip to content

Commit

Permalink
Merge branch 'main' into renovate/dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-cal authored Apr 3, 2024
2 parents dfbacdd + d415ce5 commit fa03734
Show file tree
Hide file tree
Showing 22 changed files with 233 additions and 427 deletions.
58 changes: 29 additions & 29 deletions snapcraft/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,60 +220,60 @@ def create_app() -> Snapcraft:
app.add_command_group(
"Store Account",
[
unimplemented.Login,
unimplemented.ExportLogin,
unimplemented.Logout,
unimplemented.Whoami,
commands.StoreExportLoginCommand,
commands.StoreLoginCommand,
commands.StoreLogoutCommand,
commands.StoreWhoAmICommand,
],
)
app.add_command_group(
"Store Snap Names",
[
unimplemented.Register,
unimplemented.Names,
unimplemented.ListRegistered,
unimplemented.List,
unimplemented.Metrics,
unimplemented.UploadMetadata,
commands.StoreRegisterCommand,
commands.StoreNamesCommand,
commands.StoreLegacyListRegisteredCommand,
commands.StoreLegacyListCommand,
commands.StoreLegacyMetricsCommand,
commands.StoreLegacyUploadMetadataCommand,
],
)
app.add_command_group(
"Store Snap Release Management",
[
unimplemented.Release,
unimplemented.Close,
unimplemented.Status,
unimplemented.Upload,
unimplemented.Push,
unimplemented.Promote,
unimplemented.ListRevisions,
unimplemented.Revisions,
commands.StoreReleaseCommand,
commands.StoreCloseCommand,
commands.StoreStatusCommand,
commands.StoreUploadCommand,
commands.StoreLegacyPushCommand,
commands.StoreLegacyPromoteCommand,
commands.StoreListRevisionsCommand,
commands.StoreRevisionsCommand,
],
)
app.add_command_group(
"Store Snap Tracks",
[
unimplemented.ListTracks,
unimplemented.Tracks,
unimplemented.SetDefaultTrack,
commands.StoreListTracksCommand,
commands.StoreTracksCommand,
commands.StoreLegacySetDefaultTrackCommand,
],
)
app.add_command_group(
"Store Key Management",
[
unimplemented.CreateKey,
unimplemented.RegisterKey,
unimplemented.SignBuild,
unimplemented.ListKeys,
commands.StoreLegacyCreateKeyCommand,
commands.StoreLegacyRegisterKeyCommand,
commands.StoreLegacySignBuildCommand,
commands.StoreLegacyListKeysCommand,
],
)
app.add_command_group(
"Store Validation Sets",
[
unimplemented.EditValidationSets,
unimplemented.ListValidationSets,
unimplemented.Validate,
unimplemented.Gated,
commands.StoreEditValidationSetsCommand,
commands.StoreLegacyListValidationSetsCommand,
commands.StoreLegacyValidateCommand,
commands.StoreLegacyGatedCommand,
],
)
app.add_command_group(
Expand Down
58 changes: 29 additions & 29 deletions snapcraft/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,60 +62,60 @@
craft_cli.CommandGroup(
"Store Account",
[
commands.core22.StoreLoginCommand,
commands.core22.StoreExportLoginCommand,
commands.core22.StoreLogoutCommand,
commands.core22.StoreWhoAmICommand,
commands.StoreLoginCommand,
commands.StoreExportLoginCommand,
commands.StoreLogoutCommand,
commands.StoreWhoAmICommand,
],
),
craft_cli.CommandGroup(
"Store Snap Names",
[
commands.core22.StoreRegisterCommand,
commands.core22.StoreNamesCommand,
commands.legacy.StoreLegacyListRegisteredCommand,
commands.legacy.StoreLegacyListCommand,
commands.legacy.StoreLegacyMetricsCommand,
commands.legacy.StoreLegacyUploadMetadataCommand,
commands.StoreRegisterCommand,
commands.StoreNamesCommand,
commands.StoreLegacyListRegisteredCommand,
commands.StoreLegacyListCommand,
commands.StoreLegacyMetricsCommand,
commands.StoreLegacyUploadMetadataCommand,
],
),
craft_cli.CommandGroup(
"Store Snap Release Management",
[
commands.core22.StoreReleaseCommand,
commands.core22.StoreCloseCommand,
commands.core22.StoreStatusCommand,
commands.core22.StoreUploadCommand,
commands.legacy.StoreLegacyPushCommand, # hidden (legacy for upload)
commands.legacy.StoreLegacyPromoteCommand,
commands.core22.StoreListRevisionsCommand,
commands.core22.StoreRevisionsCommand, # hidden (alias to list-revisions)
commands.StoreReleaseCommand,
commands.StoreCloseCommand,
commands.StoreStatusCommand,
commands.StoreUploadCommand,
commands.StoreLegacyPushCommand, # hidden (legacy for upload)
commands.StoreLegacyPromoteCommand,
commands.StoreListRevisionsCommand,
commands.StoreRevisionsCommand, # hidden (alias to list-revisions)
],
),
craft_cli.CommandGroup(
"Store Snap Tracks",
[
commands.core22.StoreListTracksCommand,
commands.core22.StoreTracksCommand, # hidden (alias to list-tracks)
commands.legacy.StoreLegacySetDefaultTrackCommand,
commands.StoreListTracksCommand,
commands.StoreTracksCommand, # hidden (alias to list-tracks)
commands.StoreLegacySetDefaultTrackCommand,
],
),
craft_cli.CommandGroup(
"Store Key Management",
[
commands.legacy.StoreLegacyCreateKeyCommand,
commands.legacy.StoreLegacyRegisterKeyCommand,
commands.legacy.StoreLegacySignBuildCommand,
commands.legacy.StoreLegacyListKeysCommand,
commands.StoreLegacyCreateKeyCommand,
commands.StoreLegacyRegisterKeyCommand,
commands.StoreLegacySignBuildCommand,
commands.StoreLegacyListKeysCommand,
],
),
craft_cli.CommandGroup(
"Store Validation Sets",
[
commands.core22.StoreEditValidationSetsCommand,
commands.legacy.StoreLegacyListValidationSetsCommand,
commands.legacy.StoreLegacyValidateCommand,
commands.legacy.StoreLegacyGatedCommand,
commands.StoreEditValidationSetsCommand,
commands.StoreLegacyListValidationSetsCommand,
commands.StoreLegacyValidateCommand,
commands.StoreLegacyGatedCommand,
],
),
craft_cli.CommandGroup(
Expand Down
74 changes: 69 additions & 5 deletions snapcraft/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2022 Canonical Ltd.
# Copyright 2022,2024 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
Expand All @@ -17,15 +17,79 @@
"""Snapcraft commands."""

from . import core22, legacy
from .account import (
StoreExportLoginCommand,
StoreLoginCommand,
StoreLogoutCommand,
StoreWhoAmICommand,
)
from .extensions import ExpandExtensions, ListExtensions
from .legacy import (
StoreLegacyCreateKeyCommand,
StoreLegacyGatedCommand,
StoreLegacyListKeysCommand,
StoreLegacyListValidationSetsCommand,
StoreLegacyMetricsCommand,
StoreLegacyPromoteCommand,
StoreLegacyRegisterKeyCommand,
StoreLegacySetDefaultTrackCommand,
StoreLegacySignBuildCommand,
StoreLegacyUploadMetadataCommand,
StoreLegacyValidateCommand,
)
from .lifecycle import SnapCommand
from .manage import StoreCloseCommand, StoreReleaseCommand
from .names import (
StoreLegacyListCommand,
StoreLegacyListRegisteredCommand,
StoreNamesCommand,
StoreRegisterCommand,
)
from .remote import RemoteBuildCommand
from .status import (
StoreListRevisionsCommand,
StoreListTracksCommand,
StoreRevisionsCommand,
StoreStatusCommand,
StoreTracksCommand,
)
from .upload import StoreLegacyPushCommand, StoreUploadCommand
from .validation_sets import StoreEditValidationSetsCommand

__all__ = [
"core22",
"legacy",
"SnapCommand",
"RemoteBuildCommand",
"ExpandExtensions",
"ListExtensions",
"RemoteBuildCommand",
"SnapCommand",
"StoreCloseCommand",
"StoreEditValidationSetsCommand",
"StoreExportLoginCommand",
"StoreLegacyCreateKeyCommand",
"StoreLegacyGatedCommand",
"StoreLegacyListCommand",
"StoreLegacyListKeysCommand",
"StoreLegacyListRegisteredCommand",
"StoreLegacyListValidationSetsCommand",
"StoreLegacyMetricsCommand",
"StoreLegacyPromoteCommand",
"StoreLegacyPushCommand",
"StoreLegacyRegisterKeyCommand",
"StoreLegacySetDefaultTrackCommand",
"StoreLegacySignBuildCommand",
"StoreLegacyUploadMetadataCommand",
"StoreLegacyValidateCommand",
"StoreListRevisionsCommand",
"StoreListTracksCommand",
"StoreLoginCommand",
"StoreLogoutCommand",
"StoreNamesCommand",
"StoreRegisterCommand",
"StoreReleaseCommand",
"StoreRevisionsCommand",
"StoreStatusCommand",
"StoreTracksCommand",
"StoreUploadCommand",
"StoreWhoAmICommand",
"core22",
"legacy",
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2022 Canonical Ltd.
# Copyright 2022,2024 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
Expand All @@ -25,7 +25,8 @@
from datetime import datetime
from typing import TYPE_CHECKING, Any, Dict

from craft_cli import BaseCommand, emit
from craft_application.commands import AppCommand
from craft_cli import emit
from craft_cli.errors import ArgumentParsingError
from overrides import overrides

Expand Down Expand Up @@ -53,7 +54,7 @@ def _read_config(config_path) -> str:
return config_file.read_text(encoding="utf-8")


class StoreLoginCommand(BaseCommand):
class StoreLoginCommand(AppCommand):
"""Command to log in to the Snap Store."""

name = "login"
Expand Down Expand Up @@ -115,7 +116,7 @@ def run(self, parsed_args):
emit.message("Login successful")


class StoreExportLoginCommand(BaseCommand):
class StoreExportLoginCommand(AppCommand):
"""Command to export login to use with the Snap Store."""

name = "export-login"
Expand Down Expand Up @@ -241,7 +242,7 @@ def run(self, parsed_args):
emit.message(message)


class StoreWhoAmICommand(BaseCommand):
class StoreWhoAmICommand(AppCommand):
"""Command to show login information from Snap Store."""

name = "whoami"
Expand Down Expand Up @@ -287,7 +288,7 @@ def run(self, parsed_args):
emit.message(message)


class StoreLogoutCommand(BaseCommand):
class StoreLogoutCommand(AppCommand):
"""Command to log out from the Snap Store."""

name = "logout"
Expand Down
34 changes: 1 addition & 33 deletions snapcraft/commands/core22/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2022 Canonical Ltd.
# Copyright 2022,2024 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
Expand All @@ -16,12 +16,6 @@

"""Snapcraft commands for core22 base."""

from .account import (
StoreExportLoginCommand,
StoreLoginCommand,
StoreLogoutCommand,
StoreWhoAmICommand,
)
from .discovery import ListPluginsCommand, PluginsCommand
from .extensions import (
ExpandExtensionsCommand,
Expand All @@ -40,18 +34,7 @@
TryCommand,
)
from .lint import LintCommand
from .manage import StoreCloseCommand, StoreReleaseCommand
from .names import StoreNamesCommand, StoreRegisterCommand
from .remote import RemoteBuildCommand
from .status import (
StoreListRevisionsCommand,
StoreListTracksCommand,
StoreRevisionsCommand,
StoreStatusCommand,
StoreTracksCommand,
)
from .upload import StoreUploadCommand
from .validation_sets import StoreEditValidationSetsCommand

__all__ = [
"BuildCommand",
Expand All @@ -69,20 +52,5 @@
"RemoteBuildCommand",
"SnapCommand",
"StageCommand",
"StoreCloseCommand",
"StoreEditValidationSetsCommand",
"StoreExportLoginCommand",
"StoreListTracksCommand",
"StoreListRevisionsCommand",
"StoreLoginCommand",
"StoreLogoutCommand",
"StoreNamesCommand",
"StoreRegisterCommand",
"StoreReleaseCommand",
"StoreRevisionsCommand",
"StoreStatusCommand",
"StoreTracksCommand",
"StoreUploadCommand",
"StoreWhoAmICommand",
"TryCommand",
]
Loading

0 comments on commit fa03734

Please sign in to comment.