Skip to content

Commit

Permalink
Tox changes in prep for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashb committed Oct 10, 2019
1 parent 8c706d3 commit 8187aaf
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 27 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Release History
===============

dev
---
0.3 (2019-10-09)
----------------

* Add a `defaults` method as part of Container objects when assigned defaults in one field based on another
* Add support for Command Handlers
Expand Down
9 changes: 5 additions & 4 deletions src/protean/impl/broker/rq_broker.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Standard Library Imports
import logging
import logging.config
import os

from collections import defaultdict

from redis import Redis
from rq import get_current_connection, push_connection, Queue, Worker

# Protean
from protean.core.broker.base import BaseBroker
from protean.core.domain_event import BaseDomainEvent
from protean.domain import DomainObjects, Domain
from protean.domain import Domain, DomainObjects
from protean.utils import fully_qualified_name
from protean.utils.inflection import underscore
from redis import Redis
from rq import Queue, Worker, get_current_connection, push_connection

logger = logging.getLogger('protean.impl.broker.rq')

Expand Down
2 changes: 1 addition & 1 deletion src/protean/impl/repository/dict_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json

from collections import defaultdict
from datetime import datetime, date
from datetime import date, datetime
from itertools import count
from operator import itemgetter
from threading import Lock
Expand Down
4 changes: 2 additions & 2 deletions src/protean/impl/repository/elasticsearch_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from typing import Any
from uuid import UUID

# Protean
import elasticsearch_dsl

from elasticsearch import Elasticsearch
from elasticsearch.exceptions import NotFoundError
from elasticsearch_dsl import Document, Index, query, Search

from elasticsearch_dsl import Document, Index, Search, query
from protean.core.exceptions import ObjectNotFoundError
from protean.core.field.association import Reference
from protean.core.provider.base import BaseProvider
Expand Down
2 changes: 1 addition & 1 deletion tests/command_handler/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from protean.utils import fully_qualified_name

# Local/Relative Imports
from .elements import AddPersonCommand, AddNewPersonCommandHandler
from .elements import AddNewPersonCommandHandler, AddPersonCommand


class TestCommandHandlerInitialization:
Expand Down
1 change: 1 addition & 0 deletions tests/entity/elements.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Standard Library Imports
from collections import defaultdict
from enum import Enum

Expand Down
2 changes: 2 additions & 0 deletions tests/entity/test_lifecycle_methods.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Protean
import pytest

from protean.core.exceptions import ValidationError

# Local/Relative Imports
from .elements import Building, BuildingStatus


Expand Down
6 changes: 3 additions & 3 deletions tests/impl/broker/rq_broker/conftest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Standard Library Imports
import os

from redis import Redis
from rq import get_current_connection, push_connection, pop_connection

# Protean
import pytest

from redis import Redis
from rq import get_current_connection, pop_connection, push_connection


def initialize_domain():
from protean.domain import Domain
Expand Down
4 changes: 3 additions & 1 deletion tests/impl/broker/rq_broker/test_subscriber.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Standard Library Imports
import multiprocessing

# Protean
import pytest

from rq import Queue, Worker

from tests.impl.broker.rq_broker.elements import NotifySSOSubscriber, Person


Expand Down
9 changes: 4 additions & 5 deletions tests/impl/broker/rq_broker/tests.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import rq
# Protean
import pytest
import rq

from mock import patch
from redis import Redis
from rq import Queue

from protean.globals import current_domain
from protean.impl.broker.rq_broker import RqBroker
from protean.utils import fully_qualified_name

from redis import Redis
from rq import Queue
from tests.impl.broker.rq_broker.elements import NotifySSOSubscriber, Person, PersonAdded


Expand Down
2 changes: 2 additions & 0 deletions tests/impl/repository/dict_repo/test_lookups.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Standard Library Imports
from datetime import datetime

# Protean
from protean.impl.repository.dict_repo import Exact


Expand Down
4 changes: 2 additions & 2 deletions tests/impl/repository/elasticsearch_repo/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Standard Library Imports
import os

from elasticsearch_dsl import Index

# Protean
import pytest

from elasticsearch_dsl import Index


def initialize_domain():
from protean.domain import Domain
Expand Down
1 change: 0 additions & 1 deletion tests/impl/repository/elasticsearch_repo/test_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest

from elasticsearch import Elasticsearch

from protean.core.exceptions import ObjectNotFoundError, TooManyObjectsError, ValidationError
from protean.core.queryset import Q, QuerySet

Expand Down
1 change: 1 addition & 0 deletions tests/impl/repository/elasticsearch_repo/test_lookup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Protean
import pytest

from protean.impl.repository import elasticsearch_repo as repo
Expand Down
4 changes: 3 additions & 1 deletion tests/impl/repository/elasticsearch_repo/test_model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Protean
import pytest

from protean.impl.repository.elasticsearch_repo import ElasticsearchModel

from .elements import Email, Person, ComplexUser
# Local/Relative Imports
from .elements import ComplexUser, Email, Person


@pytest.mark.elasticsearch
Expand Down
2 changes: 1 addition & 1 deletion tests/impl/repository/elasticsearch_repo/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Protean
import pytest

from protean.impl.repository.elasticsearch_repo import ESProvider
from elasticsearch import Elasticsearch
from elasticsearch_dsl.response import Response
from protean.impl.repository.elasticsearch_repo import ESProvider

# Local/Relative Imports
from .elements import Alien, Person
Expand Down
2 changes: 2 additions & 0 deletions tests/impl/repository/elasticsearch_repo/test_query.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Protean
import pytest

from elasticsearch_dsl.query import Bool, Term

# Local/Relative Imports
from .elements import Person


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Protean
from protean.impl.repository.sqlalchemy_repo import SqlalchemyModel

from .elements import Email, Person, ComplexUser
# Local/Relative Imports
from .elements import ComplexUser, Email, Person


class TestModel:
Expand Down
4 changes: 3 additions & 1 deletion tests/impl/repository/sqlalchemy_repo/sqlite/test_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Protean
from protean.impl.repository.sqlalchemy_repo import SqlalchemyModel

from .elements import Email, Person, ComplexUser
# Local/Relative Imports
from .elements import ComplexUser, Email, Person


class TestModel:
Expand Down
2 changes: 1 addition & 1 deletion tests/repository/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from protean.core.field.basic import Integer, String
from protean.core.field.embedded import ValueObjectField
from protean.core.repository.base import BaseRepository
from protean.globals import current_domain
from protean.core.value_object import BaseValueObject
from protean.globals import current_domain


class Person(BaseAggregate):
Expand Down
2 changes: 2 additions & 0 deletions tests/repository/test_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Protean
from protean.impl.repository.dict_repo import DictModel

# Local/Relative Imports
from .elements import Email, Person, User


Expand Down
2 changes: 2 additions & 0 deletions tests/value_object/test_lifecycle_methods.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Protean
import pytest

from protean.core.exceptions import ValidationError

# Local/Relative Imports
from .elements import Building, BuildingStatus


Expand Down

0 comments on commit 8187aaf

Please sign in to comment.