-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): [email protected] no longer requires "devel" (#531)
- Loading branch information
Showing
4 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ def _validate_platform_set(cls, values: Mapping[str, Any]) -> Mapping[str, Any]: | |
|
||
DEPRECATED_COLON_BASES = ["ubuntu:20.04", "ubuntu:22.04"] | ||
|
||
CURRENT_DEVEL_BASE = "ubuntu@24.04" | ||
CURRENT_DEVEL_BASE = "ubuntu@26.04" | ||
|
||
DEVEL_BASE_WARNING = ( | ||
"The development build-base should only be used for testing purposes, " | ||
|
@@ -138,7 +138,7 @@ class BuildPlanner(BaseBuildPlanner): | |
|
||
platforms: dict[str, Any] # type: ignore[reportIncompatibleVariableOverride] | ||
base: Literal["bare", "[email protected]", "[email protected]", "[email protected]"] | ||
build_base: Literal["[email protected]", "[email protected]", "devel"] | None | ||
build_base: Literal["[email protected]", "[email protected]", "[email protected]", "devel"] | None | ||
|
||
@pydantic.root_validator(skip_on_failure=True) | ||
@classmethod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
"enum": [ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"devel" | ||
], | ||
"type": "string" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: base-2404 | ||
base: [email protected] | ||
build-base: devel | ||
|
||
# Remaining contents will come from "parts.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,16 @@ | |
pytestmark = [pytest.mark.usefixtures("enable_overlay_feature")] | ||
|
||
|
||
class DevelProject(Project): | ||
"""A Project subclass that always accepts CURRENT_DEVEL_BASE as a "base". | ||
Needed because we might not have a currently supported base that is still in | ||
"development", but we want to test the behavior anyway. | ||
""" | ||
|
||
base: str # type: ignore | ||
|
||
|
||
@pytest.fixture() | ||
def yaml_data(): | ||
return ROCKCRAFT_YAML | ||
|
@@ -601,7 +611,7 @@ def test_project_generate_metadata(yaml_loaded_data): | |
|
||
|
||
def test_metadata_base_devel(yaml_loaded_data): | ||
yaml_loaded_data["base"] = CURRENT_DEVEL_BASE | ||
yaml_loaded_data["base"] = "[email protected]" | ||
yaml_loaded_data["build-base"] = "devel" | ||
project = Project.unmarshal(yaml_loaded_data) | ||
|
||
|
@@ -727,7 +737,7 @@ def test_project_devel_base(yaml_loaded_data): | |
yaml_loaded_data["build-base"] = "[email protected]" | ||
|
||
with pytest.raises(CraftValidationError) as err: | ||
_ = Project.unmarshal(yaml_loaded_data) | ||
_ = DevelProject.unmarshal(yaml_loaded_data) | ||
|
||
expected = ( | ||
f'To use the unstable base "{CURRENT_DEVEL_BASE}", ' | ||
|
@@ -737,7 +747,7 @@ def test_project_devel_base(yaml_loaded_data): | |
|
||
|
||
def test_get_effective_devel_base(yaml_loaded_data): | ||
yaml_loaded_data["base"] = CURRENT_DEVEL_BASE | ||
yaml_loaded_data["base"] = "[email protected]" | ||
yaml_loaded_data["build-base"] = "devel" | ||
project = Project.unmarshal(yaml_loaded_data) | ||
|
||
|
@@ -750,6 +760,6 @@ def test_devel_base_warning(yaml_loaded_data, emitter): | |
yaml_loaded_data["base"] = CURRENT_DEVEL_BASE | ||
yaml_loaded_data["build-base"] = "devel" | ||
del yaml_loaded_data["entrypoint-service"] | ||
_ = Project.unmarshal(yaml_loaded_data) | ||
_ = DevelProject.unmarshal(yaml_loaded_data) | ||
|
||
emitter.assert_message(DEVEL_BASE_WARNING) |