diff --git a/cookieplone/settings.py b/cookieplone/settings.py index a3c50e1..baafd54 100644 --- a/cookieplone/settings.py +++ b/cookieplone/settings.py @@ -11,21 +11,15 @@ "3.12", ] -DEFAULT_NODE = 20 +DEFAULT_NODE = 22 SUPPORTED_NODE_VERSIONS = [ - "16", - "17", - "18", - "19", "20", "22", ] -VOLTO_MIN_VERSION = "16" +VOLTO_MIN_VERSION = "18.0.0-alpha.1" VOLTO_NODE = { - 16: 16, - 17: DEFAULT_NODE, 18: 22, } MIN_DOCKER_VERSION = "20.10" diff --git a/cookieplone/utils/validators.py b/cookieplone/utils/validators.py index 2f6b522..16fc213 100644 --- a/cookieplone/utils/validators.py +++ b/cookieplone/utils/validators.py @@ -94,7 +94,7 @@ def validate_volto_version(value: str) -> str: status = bool(version) and ( version >= _version_from_str(settings.VOLTO_MIN_VERSION) ) - return "" if status else f"{value} is not a valid Volto version." + return "" if status else f"Volto version {value} is not supported by this template." def run_context_validations( diff --git a/news/49.bugfix b/news/49.bugfix index 94d3d30..20e6119 100644 --- a/news/49.bugfix +++ b/news/49.bugfix @@ -1 +1 @@ -Don't fail validation when using Node 22. @davisagli +Fix validation of Volto and Node versions. @davisagli diff --git a/tests/test_filters.py b/tests/test_filters.py index a98d4b2..69c87c6 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -37,7 +37,7 @@ def func(filter_: str) -> Path: ["package_path", "{{'foo.bar.baz' | package_path}}", "foo/bar/baz"], ["pascal_case", "{{'foo_bar' | pascal_case}}", "FooBar"], ["use_prerelease_versions", "{{ '' | use_prerelease_versions }}", "No"], - ["node_version_for_volto", "{{'17' | node_version_for_volto}}", "20"], + ["node_version_for_volto", "{{'18' | node_version_for_volto}}", "22"], ["gs_language_code", "{{'ES' | gs_language_code}}", "es"], ["gs_language_code", "{{'es-MX' | gs_language_code}}", "es-mx"], ["locales_language_code", "{{'es-mx' | locales_language_code}}", "es_MX"], diff --git a/tests/utils/test_validators.py b/tests/utils/test_validators.py index 5c7c56a..e8973bf 100644 --- a/tests/utils/test_validators.py +++ b/tests/utils/test_validators.py @@ -184,10 +184,9 @@ def test_validate_plone_version(version: str, expected: str): @pytest.mark.parametrize( "version,expected", ( - ("14.0.0", "14.0.0 is not a valid Volto version."), ("18.0.0-alpha.21", ""), - ("17.0.0", ""), - ("16.15.1", ""), + ("17.0.0", "Volto version 17.0.0 is not supported by this template."), + ("16.15.1", "Volto version 16.15.1 is not supported by this template."), ), ) def test_validate_volto_version(version: str, expected: str):