Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename default distribution to volto #162

Merged
merged 4 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ifeq ($(PYTHON_VERSION_OK),0)
endif

# Set distributions still in development
DISTRIBUTIONS="default"
DISTRIBUTIONS="volto"

all: build

Expand Down
2 changes: 1 addition & 1 deletion mx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[settings]
main-package = -e .[test]
version-overrides =
plone.volto==5.0.0a1.dev0
plone.volto==5.0.0b2.dev0

[plone.distribution]
url = https://github.com/plone/plone.distribution.git
Expand Down
1 change: 1 addition & 0 deletions news/161.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename `default` distribution to `volto`. @davisagli
6 changes: 3 additions & 3 deletions src/plone/volto/distributions.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
>

<plone:distribution
name="default"
title="Plone Site"
name="volto"
title="Plone Site (Volto)"
description="A Plone Site to be used with a Volto frontend"
directory="distributions/default"
directory="distributions/volto"
post_handler="plone.distribution.handler.post_handler"
/>

Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>1017</version>
<version>1018</version>
<dependencies>
<dependency>profile-plone.restapi:blocks</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class BaseFixture(PloneDistributionFixture):
PACKAGE_NAME = "plone.volto"
SITES = (("default", ANSWERS),)
SITES = (("volto", ANSWERS),)
_distribution_products = (
("plone.app.contenttypes", {"loadZCML": True}),
("plone.app.caching", {"loadZCML": True}),
Expand Down
13 changes: 13 additions & 0 deletions src/plone/volto/upgrades.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy
from OFS.interfaces import IOrderedContainer
from plone import api
from plone.base.interfaces import IPloneSiteRoot
from plone.registry import field
from plone.registry.interfaces import IRegistry
from plone.registry.record import Record
Expand Down Expand Up @@ -143,3 +144,15 @@ def add_block_types_index(context):
if index % 250 == 0:
logger.info(f"Reindexed {index}/{total} objects")
transaction.commit()


def rename_distribution(context):
from plone.distribution.api.distribution import get_creation_report

portal = getUtility(IPloneSiteRoot)
report = get_creation_report(portal)
if report is not None:
if report.name == "default":
report.name = "volto"
if report.answers.get("distribution") == "default":
report.answers["distribution"] = "volto"
11 changes: 11 additions & 0 deletions src/plone/volto/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,15 @@
/>
</genericsetup:upgradeSteps>

<genericsetup:upgradeSteps
profile="plone.volto:default"
source="1017"
destination="1018"
>
<genericsetup:upgradeStep
title="Rename default distribution to volto"
handler=".upgrades.rename_distribution"
/>
</genericsetup:upgradeSteps>

</configure>
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@pytest.fixture
def distribution_name() -> str:
"""Distribution name."""
return "default"
return "volto"


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/distribution/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_distribution_class(self):
@pytest.mark.parametrize(
"attr,expected",
[
["title", "Plone Site"],
["title", "Plone Site (Volto)"],
[
"description",
"A Plone Site to be used with a Volto frontend",
Expand Down
2 changes: 1 addition & 1 deletion tests/setup/test_setup_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_browserlayer(self, browser_layers):

def test_latest_version(self, profile_last_version):
"""Test latest version of default profile."""
assert profile_last_version(f"{PACKAGE_NAME}:default") == "1017"
assert profile_last_version(f"{PACKAGE_NAME}:default") == "1018"

@pytest.mark.parametrize(
"portal_type,behavior",
Expand Down