Skip to content

Commit

Permalink
style: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bepri committed Feb 14, 2025
1 parent 19e6227 commit f4df68e
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 208 deletions.
10 changes: 5 additions & 5 deletions docs/explanation/remote-build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ different architectures.
Architectures supported by Launchpad can be found
:ref:`here<supported-architectures>`.

Public vs. Private projects
Public and private projects
---------------------------

By default, prospective snaps will be publicly uploaded to `Launchpad`_.
By default, prospective snaps are publicly uploaded to `Launchpad`_.

Developers are reminded of this by confirming that their project will be
publicly available when starting a remote build. This prompt can be
Expand Down Expand Up @@ -85,7 +85,7 @@ Current
``--build-for``
***************
**Type**: Comma-separated list of strings
**Default**: The architectures specified in your project file
**Default**: The architectures specified in your project file or your host architecture

.. note::
``--build-for`` behaves differently for ``remote-build`` than it does for
Expand All @@ -112,8 +112,8 @@ defines the architectures to build for.
``--launchpad-accept-public-upload``
************************************

Used to bypass the interactive prompt for confirming the public upload of data. It is
not necessary to use this flag if using ``--project`` to specify a private project.
Bypasses the prompt that confirms whether you want to upload data to the public. It's
not necessary to use this flag if you used ``--project`` to specify a private project.

``--project``
*************
Expand Down
8 changes: 6 additions & 2 deletions snapcraft/commands/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def _pre_build(self, parsed_args: argparse.Namespace):
)

project = cast(models.Project, self._services.project)
build_plan = self._app.BuildPlannerClass.unmarshal(project.marshal()).get_build_plan()
build_plan = self._app.BuildPlannerClass.unmarshal(
project.marshal()
).get_build_plan()

# mapping of `build-on` to `build-for` architectures
build_map: dict[str, list[str]] = {}
Expand Down Expand Up @@ -138,7 +140,9 @@ def _pre_build(self, parsed_args: argparse.Namespace):
@override
def _get_build_args(self, parsed_args: argparse.Namespace) -> dict[str, Any]:
project = cast(models.Project, self._services.project)
build_plan = self._app.BuildPlannerClass.unmarshal(project.marshal()).get_build_plan()
build_plan = self._app.BuildPlannerClass.unmarshal(
project.marshal()
).get_build_plan()
build_fors = cast(list[str], parsed_args.remote_build_build_fors)
archs: list[str] = []
if project.platforms or project._architectures_in_yaml:
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/models/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2572,10 +2572,7 @@ def test_project_platform_unknown_name():
}
)

assert (
"'unknown' is not a valid Debian architecture."
in str(raised.value)
)
assert "'unknown' is not a valid Debian architecture." in str(raised.value)


@pytest.mark.parametrize("project", [ComponentProject, Project])
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def mock_run_legacy(mocker):
@pytest.fixture()
def mock_remote_build_argv(mocker):
"""Mock `snapcraft remote-build` cli."""
return mocker.patch.object(sys, "argv", ["snapcraft", "remote-build", "--launchpad-accept-public-upload"])
return mocker.patch.object(
sys, "argv", ["snapcraft", "remote-build", "--launchpad-accept-public-upload"]
)


@pytest.mark.parametrize("env_vars", application.MAPPED_ENV_VARS.items())
Expand Down
Loading

0 comments on commit f4df68e

Please sign in to comment.