craft-application 4.2.3__tar.gz → 4.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {craft_application-4.2.3/craft_application.egg-info → craft_application-4.2.4}/PKG-INFO +1 -1
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/_version.py +2 -2
- craft_application-4.2.4/craft_application/remote/errors.py +54 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/remote/git.py +4 -2
- {craft_application-4.2.3 → craft_application-4.2.4/craft_application.egg-info}/PKG-INFO +1 -1
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/SOURCES.txt +1 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/reference/changelog.rst +11 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/git/test_git.py +1 -1
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/remote/test_errors.py +11 -15
- craft_application-4.2.4/tests/unit/remote/test_git.py +57 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/remote/test_utils.py +2 -1
- craft_application-4.2.3/craft_application/remote/errors.py +0 -76
- {craft_application-4.2.3 → craft_application-4.2.4}/.editorconfig +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/.jira_sync_config.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/ISSUE_TEMPLATE/bug.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/ISSUE_TEMPLATE/task.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/release-drafter.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/release-drafter.yml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/renovate.json5 +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/check-renovate.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/cla-check.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/docs.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/release-drafter.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/release-publish.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.github/workflows/tests.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.gitignore +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.pre-commit-config.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.readthedocs.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/.yamllint.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/HACKING.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/LICENSE +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/README.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/_config.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/application.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/commands/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/commands/base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/commands/lifecycle.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/commands/other.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/errors.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/git/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/git/_errors.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/git/_git_repo.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/git/_models.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/grammar.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/errors.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/launchpad.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/build.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/code.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/distro.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/project.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/recipe.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/util.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/misc/instance_bashrc +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/constraints.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/grammar.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/metadata.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/models/project.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/py.typed +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/remote/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/remote/utils.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/remote/worktree.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/secrets.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/config.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/lifecycle.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/package.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/provider.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/remotebuild.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/request.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/service_factory.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/callbacks.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/docs.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/error_formatting.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/logging.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/paths.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/platforms.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/repositories.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/retry.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/snap_config.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/string.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/yaml.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/dependency_links.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/requires.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/top_level.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/conf.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/explanation/build-plans.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/explanation/index.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/howto/index.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/howto/partitions.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/index.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/reference/environment-variables.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/reference/index.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/reference/platforms.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/docs/tutorials/index.rst +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/pyproject.toml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/setup.cfg +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/build-secrets/secret-source-folder/source-file.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/build-secrets/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/invalid_projects/build-error/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/adoption/stderr +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/adoption/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/basic/stderr +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/basic/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/build-for-all/stderr +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/build-for-all/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/environment/stderr +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/environment/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/grammar/src/on-amd64-to-amd64/hello.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/grammar/src/on-amd64-to-arm64/hello.txt +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/grammar/stderr +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/data/valid_projects/grammar/testcraft.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/launchpad/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/launchpad/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/launchpad/test_anonymous_access.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_lifecycle.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_provider.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_remotebuild.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_request.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_service_factory.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/test_application.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/test_version.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/commands/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/commands/test_base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/commands/test_lifecycle.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/commands/test_other.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/git/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/git/test_errors.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/models/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/models/test_base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/models/test_code.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/test_launchpad.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/test_util.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/project_models/basic_project.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/project_models/full_project.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/project_models/invalid_project.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/test_base.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/test_constraints.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/test_grammar.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/models/test_project.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/remote/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/remote/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/remote/test_worktree.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/conftest.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_config.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_lifecycle.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_package.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_provider.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_remotebuild.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_repositories.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_request.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_service_factory.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/test_application.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/test_errors.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/test_grammar.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/test_nothing.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/test_secrets.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/__init__.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/invalid_yaml/_README +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/invalid_yaml/duplicate_second_level.yaml-invalid +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/invalid_yaml/duplicate_top_level.yaml-invalid +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/invalid_yaml/unhashable.yaml-invalid +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_docs.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_error_formatting.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_logging.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_paths.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_platforms.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_retry.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_snap_config.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_string.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_yaml.py +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/valid_yaml/empty.yaml +0 -0
- {craft_application-4.2.3 → craft_application-4.2.4}/tox.ini +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright 2023-2024 Canonical Ltd.
|
|
2
|
+
#
|
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
|
4
|
+
# it under the terms of the GNU Lesser General Public License version 3 as
|
|
5
|
+
# published by the Free Software Foundation.
|
|
6
|
+
#
|
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10
|
+
# GNU Lesser General Public License for more details.
|
|
11
|
+
#
|
|
12
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
13
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
15
|
+
"""Remote build errors."""
|
|
16
|
+
|
|
17
|
+
import craft_cli.errors
|
|
18
|
+
|
|
19
|
+
from craft_application.util import humanize_list
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RemoteBuildError(craft_cli.errors.CraftError):
|
|
23
|
+
"""Error for remote builds."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class RemoteBuildGitError(RemoteBuildError):
|
|
27
|
+
"""Git repository cannot be prepared correctly.
|
|
28
|
+
|
|
29
|
+
:param message: Git error message.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self, message: str) -> None:
|
|
33
|
+
message = f"Git operation failed with: {message}"
|
|
34
|
+
super().__init__(message=message)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class UnsupportedArchitectureError(RemoteBuildError):
|
|
38
|
+
"""Unsupported architecture error.
|
|
39
|
+
|
|
40
|
+
:param architectures: List of unsupported architectures.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self, architectures: list[str]) -> None:
|
|
44
|
+
message = (
|
|
45
|
+
"The following architectures are not supported by the remote builder: "
|
|
46
|
+
f"{humanize_list(architectures, 'and')}."
|
|
47
|
+
)
|
|
48
|
+
resolution = "Remove them from the architecture list and try again."
|
|
49
|
+
|
|
50
|
+
super().__init__(message=message, resolution=resolution)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class RemoteBuildInvalidGitRepoError(RemoteBuildError):
|
|
54
|
+
"""The Git repository is invalid for remote build."""
|
|
@@ -32,10 +32,12 @@ def check_git_repo_for_remote_build(path: Path) -> None:
|
|
|
32
32
|
|
|
33
33
|
if git_type == GitType.INVALID:
|
|
34
34
|
raise RemoteBuildInvalidGitRepoError(
|
|
35
|
-
f"Could not find a git repository in {str(path)!r}"
|
|
35
|
+
message=f"Could not find a git repository in {str(path)!r}",
|
|
36
|
+
resolution="Initialize a git repository in the project directory",
|
|
36
37
|
)
|
|
37
38
|
|
|
38
39
|
if git_type == GitType.SHALLOW:
|
|
39
40
|
raise RemoteBuildInvalidGitRepoError(
|
|
40
|
-
"Remote
|
|
41
|
+
message="Remote builds for shallow cloned git repos are not supported",
|
|
42
|
+
resolution="Make a non-shallow clone of the repository",
|
|
41
43
|
)
|
|
@@ -160,6 +160,7 @@ tests/unit/models/project_models/invalid_project.yaml
|
|
|
160
160
|
tests/unit/remote/__init__.py
|
|
161
161
|
tests/unit/remote/conftest.py
|
|
162
162
|
tests/unit/remote/test_errors.py
|
|
163
|
+
tests/unit/remote/test_git.py
|
|
163
164
|
tests/unit/remote/test_utils.py
|
|
164
165
|
tests/unit/remote/test_worktree.py
|
|
165
166
|
tests/unit/services/__init__.py
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
Changelog
|
|
3
3
|
*********
|
|
4
4
|
|
|
5
|
+
4.2.4 (2024-Sep-19)
|
|
6
|
+
-------------------
|
|
7
|
+
|
|
8
|
+
Remote build
|
|
9
|
+
============
|
|
10
|
+
|
|
11
|
+
- Remote build errors are now a subclass of ``CraftError``.
|
|
12
|
+
|
|
13
|
+
For a complete list of commits, check out the `4.2.4`_ release on GitHub.
|
|
14
|
+
|
|
5
15
|
4.2.3 (2024-Sep-18)
|
|
6
16
|
-------------------
|
|
7
17
|
|
|
@@ -278,3 +288,4 @@ For a complete list of commits, check out the `2.7.0`_ release on GitHub.
|
|
|
278
288
|
.. _4.2.1: https://github.com/canonical/craft-application/releases/tag/4.2.1
|
|
279
289
|
.. _4.2.2: https://github.com/canonical/craft-application/releases/tag/4.2.2
|
|
280
290
|
.. _4.2.3: https://github.com/canonical/craft-application/releases/tag/4.2.3
|
|
291
|
+
.. _4.2.4: https://github.com/canonical/craft-application/releases/tag/4.2.4
|
|
@@ -894,6 +894,6 @@ def test_check_git_repo_for_remote_build_shallow(empty_working_directory):
|
|
|
894
894
|
|
|
895
895
|
with pytest.raises(
|
|
896
896
|
RemoteBuildInvalidGitRepoError,
|
|
897
|
-
match="Remote
|
|
897
|
+
match="Remote builds for shallow cloned git repos are not supported",
|
|
898
898
|
):
|
|
899
899
|
check_git_repo_for_remote_build(git_shallow_path)
|
|
@@ -15,25 +15,21 @@
|
|
|
15
15
|
from craft_application.remote import errors
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
def test_git_error():
|
|
19
|
+
"""Test RemoteBuildGitError."""
|
|
20
|
+
error = errors.RemoteBuildGitError(message="failed to push some refs to 'unknown'")
|
|
21
|
+
|
|
22
|
+
assert (
|
|
23
|
+
str(error) == "Git operation failed with: failed to push some refs to 'unknown'"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
18
27
|
def test_unsupported_architecture_error():
|
|
19
28
|
"""Test UnsupportedArchitectureError."""
|
|
20
29
|
error = errors.UnsupportedArchitectureError(architectures=["amd64", "arm64"])
|
|
21
30
|
|
|
22
31
|
assert str(error) == (
|
|
23
|
-
"Architecture not supported by the remote builder.\nThe following "
|
|
24
|
-
"architectures are not supported by the remote builder: ['amd64', 'arm64'].\n"
|
|
25
|
-
"Please remove them from the architecture list and try again."
|
|
26
|
-
)
|
|
27
|
-
assert repr(error) == (
|
|
28
|
-
"UnsupportedArchitectureError(brief='Architecture not supported by the remote "
|
|
29
|
-
"builder.', details=\"The following architectures are not supported by the "
|
|
30
|
-
"remote builder: ['amd64', 'arm64'].\\nPlease remove them from the "
|
|
31
|
-
'architecture list and try again.")'
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
assert error.brief == "Architecture not supported by the remote builder."
|
|
35
|
-
assert error.details == (
|
|
36
32
|
"The following architectures are not supported by the remote builder: "
|
|
37
|
-
"
|
|
38
|
-
"try again."
|
|
33
|
+
"'amd64' and 'arm64'."
|
|
39
34
|
)
|
|
35
|
+
assert error.resolution == "Remove them from the architecture list and try again."
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright 2024 Canonical Ltd.
|
|
2
|
+
#
|
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
|
4
|
+
# it under the terms of the GNU Lesser General Public License version 3 as
|
|
5
|
+
# published by the Free Software Foundation.
|
|
6
|
+
#
|
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10
|
+
# GNU Lesser General Public License for more details.
|
|
11
|
+
#
|
|
12
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
13
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
15
|
+
"""Remote-build git tests."""
|
|
16
|
+
|
|
17
|
+
import pytest
|
|
18
|
+
from craft_application.git import GitType
|
|
19
|
+
from craft_application.remote import errors, git
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.fixture
|
|
23
|
+
def mock_get_git_repo_type(mocker):
|
|
24
|
+
return mocker.patch("craft_application.remote.git.get_git_repo_type")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_git_normal(tmp_path, mock_get_git_repo_type):
|
|
28
|
+
"""No-op for a normal git repo."""
|
|
29
|
+
mock_get_git_repo_type.return_value = GitType.NORMAL
|
|
30
|
+
|
|
31
|
+
assert git.check_git_repo_for_remote_build(tmp_path) is None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_git_invalid_error(tmp_path, mock_get_git_repo_type):
|
|
35
|
+
"""Raise an error for invalid git repos."""
|
|
36
|
+
mock_get_git_repo_type.return_value = GitType.INVALID
|
|
37
|
+
|
|
38
|
+
with pytest.raises(errors.RemoteBuildInvalidGitRepoError) as err:
|
|
39
|
+
git.check_git_repo_for_remote_build(tmp_path)
|
|
40
|
+
|
|
41
|
+
assert str(err.value) == f"Could not find a git repository in {str(tmp_path)!r}"
|
|
42
|
+
assert (
|
|
43
|
+
err.value.resolution == "Initialize a git repository in the project directory"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_git_shallow_clone_error(tmp_path, mock_get_git_repo_type):
|
|
48
|
+
"""Raise an error for shallowly cloned repos."""
|
|
49
|
+
mock_get_git_repo_type.return_value = GitType.SHALLOW
|
|
50
|
+
|
|
51
|
+
with pytest.raises(errors.RemoteBuildInvalidGitRepoError) as err:
|
|
52
|
+
git.check_git_repo_for_remote_build(tmp_path)
|
|
53
|
+
|
|
54
|
+
assert (
|
|
55
|
+
str(err.value) == "Remote builds for shallow cloned git repos are not supported"
|
|
56
|
+
)
|
|
57
|
+
assert err.value.resolution == "Make a non-shallow clone of the repository"
|
|
@@ -25,6 +25,7 @@ from craft_application.remote import (
|
|
|
25
25
|
validate_architectures,
|
|
26
26
|
)
|
|
27
27
|
from craft_application.remote.utils import _SUPPORTED_ARCHS
|
|
28
|
+
from craft_application.util import humanize_list
|
|
28
29
|
|
|
29
30
|
###############################
|
|
30
31
|
# validate architecture tests #
|
|
@@ -57,7 +58,7 @@ def test_validate_architectures_error(archs, expected_archs):
|
|
|
57
58
|
|
|
58
59
|
assert (
|
|
59
60
|
"The following architectures are not supported by the remote builder: "
|
|
60
|
-
f"{expected_archs}"
|
|
61
|
+
f"{humanize_list(expected_archs, 'and')}"
|
|
61
62
|
) in str(raised.value)
|
|
62
63
|
|
|
63
64
|
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Copyright 2023-2024 Canonical Ltd.
|
|
2
|
-
#
|
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
|
4
|
-
# it under the terms of the GNU Lesser General Public License version 3 as
|
|
5
|
-
# published by the Free Software Foundation.
|
|
6
|
-
#
|
|
7
|
-
# This program is distributed in the hope that it will be useful,
|
|
8
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10
|
-
# GNU Lesser General Public License for more details.
|
|
11
|
-
#
|
|
12
|
-
# You should have received a copy of the GNU Lesser General Public License
|
|
13
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
-
|
|
15
|
-
"""Remote build errors."""
|
|
16
|
-
|
|
17
|
-
from dataclasses import dataclass
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@dataclass(repr=True)
|
|
21
|
-
class RemoteBuildError(Exception):
|
|
22
|
-
"""Unexpected remote build error.
|
|
23
|
-
|
|
24
|
-
:param brief: Brief description of error.
|
|
25
|
-
:param details: Detailed information.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
brief: str
|
|
29
|
-
details: str | None = None
|
|
30
|
-
|
|
31
|
-
def __str__(self) -> str:
|
|
32
|
-
"""Return the string representation of the error."""
|
|
33
|
-
components = [self.brief]
|
|
34
|
-
|
|
35
|
-
if self.details:
|
|
36
|
-
components.append(self.details)
|
|
37
|
-
|
|
38
|
-
return "\n".join(components)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class RemoteBuildGitError(RemoteBuildError):
|
|
42
|
-
"""Git repository cannot be prepared correctly."""
|
|
43
|
-
|
|
44
|
-
def __init__(self, message: str) -> None:
|
|
45
|
-
self.message = message
|
|
46
|
-
brief = "Git operation failed"
|
|
47
|
-
details = message
|
|
48
|
-
|
|
49
|
-
super().__init__(brief=brief, details=details)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class UnsupportedArchitectureError(RemoteBuildError):
|
|
53
|
-
"""Unsupported architecture error."""
|
|
54
|
-
|
|
55
|
-
def __init__(self, architectures: list[str]) -> None:
|
|
56
|
-
brief = "Architecture not supported by the remote builder."
|
|
57
|
-
details = (
|
|
58
|
-
"The following architectures are not supported by the remote builder: "
|
|
59
|
-
f"{architectures}.\nPlease remove them from the "
|
|
60
|
-
"architecture list and try again."
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
super().__init__(brief=brief, details=details)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
class RemoteBuildInvalidGitRepoError(RemoteBuildError):
|
|
67
|
-
"""The Git repository is invalid for remote build.
|
|
68
|
-
|
|
69
|
-
:param brief: Brief description of error.
|
|
70
|
-
:param details: Detailed information.
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
def __init__(self, details: str) -> None:
|
|
74
|
-
brief = "The Git repository is invalid for remote build."
|
|
75
|
-
|
|
76
|
-
super().__init__(brief=brief, details=details)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/launchpad.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/__init__.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/base.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/build.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/code.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/distro.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/project.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/launchpad/models/recipe.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/remotebuild.py
RENAMED
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/services/service_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application/util/error_formatting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/craft_application.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/docs/reference/environment-variables.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_lifecycle.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_provider.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_remotebuild.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/integration/services/test_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/models/test_base.py
RENAMED
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/launchpad/models/test_code.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_repositories.py
RENAMED
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/services/test_service_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_application-4.2.3 → craft_application-4.2.4}/tests/unit/util/test_error_formatting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|