Skip to content

Commit

Permalink
Rename brokers and expose directly under protean package
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashb committed Sep 26, 2020
1 parent bec09c7 commit d263789
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 19 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/blocks/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ This section walks you through these mental models, and introduces the core fram
:maxdepth: 1
:glob:

ddd/*
aggregate
repository
File renamed without changes.
6 changes: 5 additions & 1 deletion src/protean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
# Local/Relative Imports
from .domain import Domain

__all__ = ("Domain",)
# Adapters
from .adapters.broker.celery import CeleryBroker, ProteanTask
from .adapters.broker.inline import InlineBroker

__all__ = ("Domain", "CeleryBroker", "ProteanTask", "InlineBroker")
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions src/protean/domain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Domain(_PackageBoundObject):
"""

# Protean
from protean.core.model import BaseModel
from protean.utils import IdentityStrategy, IdentityType

config_class = Config
Expand Down Expand Up @@ -93,11 +92,7 @@ class Domain(_PackageBoundObject):
"PROVIDER": "protean.adapters.repository.memory.MemoryProvider",
},
},
"BROKERS": {
"default": {
"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker",
},
},
"BROKERS": {"default": {"PROVIDER": "protean.InlineBroker",},},
"EMAIL_PROVIDERS": {
"default": {
"PROVIDER": "protean.adapters.email.dummy.DummyEmailProvider",
Expand Down
2 changes: 1 addition & 1 deletion tests/adapters/broker/celery_broker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Messaging Mediums
BROKERS = {
"default": {
"PROVIDER": "protean.adapters.broker.celery_broker.CeleryBroker",
"PROVIDER": "protean.CeleryBroker",
"URI": "redis://127.0.0.1:6379/2",
"IS_ASYNC": True,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/adapters/broker/celery_broker/test_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from celery import Task
from protean.globals import current_domain
from protean.adapters.broker.celery_broker import CeleryBroker, ProteanTask
from protean import CeleryBroker, ProteanTask
from tests.adapters.broker.celery_broker.elements import NotifySSOSubscriber, Person


Expand Down
2 changes: 1 addition & 1 deletion tests/adapters/broker/celery_broker/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from mock import patch
from protean.globals import current_domain
from protean.adapters.broker.celery_broker import CeleryBroker
from protean import CeleryBroker
from tests.adapters.broker.celery_broker.elements import (
NotifySSOSubscriber,
Person,
Expand Down
2 changes: 1 addition & 1 deletion tests/adapters/email/sendgrid_email/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Messaging Mediums
BROKERS = {
"default": {"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker"},
"default": {"PROVIDER": "protean.InlineBroker"},
}

EMAIL_PROVIDERS = {
Expand Down
2 changes: 1 addition & 1 deletion tests/broker/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest

from protean.port.broker import BaseBroker
from protean.adapters.broker.inline_broker import InlineBroker
from protean.adapters.broker.inline import InlineBroker


class TestBroker:
Expand Down
2 changes: 1 addition & 1 deletion tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# Messaging Mediums
BROKERS = {
"default": {"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker"},
"default": {"PROVIDER": "protean.InlineBroker"},
}

EMAIL_PROVIDERS = {
Expand Down
2 changes: 1 addition & 1 deletion tests/configuration/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_config_repr(self):
"'IDENTITY_STRATEGY': <IdentityStrategy.UUID: 1>, "
"'IDENTITY_TYPE': <IdentityType.STRING: 'STRING'>, "
"'DATABASES': {'default': {'PROVIDER': 'protean.adapters.repository.memory.MemoryProvider'}}, "
"'BROKERS': {'default': {'PROVIDER': 'protean.adapters.broker.inline_broker.InlineBroker'}}, "
"'BROKERS': {'default': {'PROVIDER': 'protean.InlineBroker'}}, "
"'EMAIL_PROVIDERS': {'default': {'PROVIDER': 'protean.adapters.email.dummy.DummyEmailProvider', "
"'DEFAULT_FROM_EMAIL': '[email protected]'}}, "
"'AGGREGATE_CHILDREN_LIMIT': 100, "
Expand Down
2 changes: 1 addition & 1 deletion tests/domain_event/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from mock import patch
from protean.core.domain_event import BaseDomainEvent
from protean.globals import current_domain
from protean.adapters.broker.inline_broker import InlineBroker
from protean.adapters.broker.inline import InlineBroker
from protean.infra.event_log import EventLog, EventLogRepository
from protean.utils import fully_qualified_name

Expand Down
2 changes: 1 addition & 1 deletion tests/identity/config_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

# Messaging Mediums
BROKERS = {
"default": {"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker"},
"default": {"PROVIDER": "protean.InlineBroker"},
}
2 changes: 1 addition & 1 deletion tests/identity/config_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

# Messaging Mediums
BROKERS = {
"default": {"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker"},
"default": {"PROVIDER": "protean.InlineBroker"},
}
2 changes: 1 addition & 1 deletion tests/identity/config_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

# Messaging Mediums
BROKERS = {
"default": {"PROVIDER": "protean.adapters.broker.inline_broker.InlineBroker"},
"default": {"PROVIDER": "protean.InlineBroker"},
}

0 comments on commit d263789

Please sign in to comment.