Skip to content

Commit

Permalink
black, flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
powderflask committed Sep 15, 2023
1 parent 7027510 commit dd1dfe7
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 37 deletions.
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"autodoc2",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinxcontrib_django",
]
Expand Down
12 changes: 8 additions & 4 deletions signoffs/core/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def can_revoke_signoff(self, approval, signoff):


class ApprovalLogic(DefaultApprovalBusinessLogic):
""" Public API: Alias for `DefaultApprovalBusinessLogic """
"""Public API: Alias for `DefaultApprovalBusinessLogic"""


class AbstractApproval:
Expand Down Expand Up @@ -501,6 +501,10 @@ class BaseApproval(AbstractApproval):
stampModel = None


__all__ =[
'revoke_approval', 'AbstractApproval', 'BaseApproval', 'DefaultApprovalBusinessLogic', 'ApprovalLogic'
]
__all__ = [
"revoke_approval",
"AbstractApproval",
"BaseApproval",
"DefaultApprovalBusinessLogic",
"ApprovalLogic",
]
3 changes: 2 additions & 1 deletion signoffs/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,11 @@ class SignoffFormsManager(class_service(service_class=SignoffTypeForms)):
- OR both... `MySignoffFormsManager = utils.service(MyInstanceForms)`
"""


__all__ = [
"AbstractSignoffForm",
"signoff_form_factory",
"AbstractSignoffRevokeForm",
"revoke_form_factory",
"SignoffFormsManager"
"SignoffFormsManager",
]
2 changes: 1 addition & 1 deletion signoffs/core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,4 +820,4 @@ def has_revoke_perm(instance, user):
"ApprovalsProcess",
"FsmApprovalsProcess",
"user_can_revoke_approval",
]
]
6 changes: 0 additions & 6 deletions signoffs/core/renderers/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ def resolve_approval_context(self, context, **kwargs):
return approval_context


"""
A descriptor class that "injects" a ApprovalInstanceRenderer instance into a Approval instance.
To inject custom rendering services:
- instantiate the descriptor with a custom service_class: ApprovalRenderer(service_class=MyInstanceRenderer);
- OR use utils.service to define a new renderer service descriptor class
"""
class ApprovalRenderer(utils.service(ApprovalInstanceRenderer)):
"""
A descriptor class that "injects" a `ApprovalInstanceRenderer` instance into a Approval instance.
Expand Down
6 changes: 5 additions & 1 deletion signoffs/core/signing_order/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from .signing_order import SigningOrder, SigningOrderStrategyProtocol, SigningOrderPatternMatcher
from .signing_order import (
SigningOrder,
SigningOrderPatternMatcher,
SigningOrderStrategyProtocol,
)
from .signoff_pattern import (
AnyOneOf,
AtLeastN,
Expand Down
6 changes: 4 additions & 2 deletions signoffs/core/signing_order/signing_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,7 @@ def __get__(self, instance, owner=None):


__all__ = [
"SigningOrder", "SigningOrderStrategyProtocol", "SigningOrderPatternMatcher",
]
"SigningOrder",
"SigningOrderStrategyProtocol",
"SigningOrderPatternMatcher",
]
2 changes: 1 addition & 1 deletion signoffs/core/signing_order/signoff_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ class InParallel(PatternSet):
"InSeries",
"OneOrMore",
"Optional",
]
]
13 changes: 9 additions & 4 deletions signoffs/core/signoffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def revoke(self, signoff, user, reason="", **kwargs):


class SignoffLogic(DefaultSignoffBusinessLogic):
""" Public API: Alias for `DefaultSignoffBusinessLogic """
"""Public API: Alias for `DefaultSignoffBusinessLogic"""


class AbstractSignoff:
Expand Down Expand Up @@ -480,6 +480,11 @@ class BaseSignoff(AbstractSignoff):
label = "I consent"


__all__ =[
'sign_signoff', 'revoke_signoff', 'AbstractSignoff', 'BaseSignoff', 'DefaultSignoffBusinessLogic', 'SignoffLogic'
]
__all__ = [
"sign_signoff",
"revoke_signoff",
"AbstractSignoff",
"BaseSignoff",
"DefaultSignoffBusinessLogic",
"SignoffLogic",
]
10 changes: 2 additions & 8 deletions signoffs/core/urls/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
from .signoffs import (
SignoffInstanceUrls,
SignoffUrlsManager,
)
from .approvals import (
ApprovalInstanceUrls,
ApprovalUrlsManager,
)
from .approvals import ApprovalInstanceUrls, ApprovalUrlsManager
from .signoffs import SignoffInstanceUrls, SignoffUrlsManager
1 change: 0 additions & 1 deletion signoffs/core/urls/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def get_revoke_url(self, args=None, kwargs=None):
)



class ApprovalUrlsManager(service(ApprovalInstanceUrls)):
"""
A descriptor class that "injects" a ApprovalInstanceUrls instance into a Approval instance.
Expand Down
2 changes: 1 addition & 1 deletion signoffs/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@ def class_service(service_class, **kwargs):
"ServiceDescriptor",
"class_service",
"ClassServiceDescriptor",
]
]
5 changes: 2 additions & 3 deletions signoffs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def object_type(self):
signoffs = SignoffTypes()
"""Singleton - the Signoff Types registry. `(see persisting_theory.Registry)`"""


def get_signoff_type(signoff_id_or_type):
"""
Return a registered Signoff Type or raise ImproperlyConfigured if no such type was registered.
Expand Down Expand Up @@ -132,6 +133,4 @@ def decorator(cls):
return decorator


__all__ = [
"signoffs", "approvals", "register"
]
__all__ = ["signoffs", "approvals", "register"]
3 changes: 2 additions & 1 deletion signoffs/signing_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
isort:skip_file
"""
from signoffs.core.signing_order.signing_order import (
SigningOrderStrategyProtocol, SigningOrder
SigningOrderStrategyProtocol,
SigningOrder,
)
from signoffs.core.signing_order.signoff_pattern import (
AnyOneOf,
Expand Down
2 changes: 1 addition & 1 deletion tasks/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def compile(c, upgrade=False, extras=(), output_file="requirements.txt", options
@task
def compile_dev(c, upgrade=False, extras=(), output_file="requirements_dev.txt", options=''):
""" pip-compile Dev requirements """
compile(c, upgrade=upgrade, extras=extras, output_file=output_file, options='--all-extras '+options)
compile(c, upgrade=upgrade, extras=extras, output_file=output_file, options='--all-extras ' + options)


@task
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.db import models
from django_fsm import FSMField, transition

from signoffs.process import FsmApprovalsProcess, user_can_revoke_approval
from signoffs.approvals import ApprovalSignoff, SimpleApproval
from signoffs.approvals import signing_order as so
from signoffs.models import (
Expand All @@ -17,6 +16,7 @@
SignoffSet,
Stamp,
)
from signoffs.process import FsmApprovalsProcess, user_can_revoke_approval
from signoffs.registry import register
from signoffs.signoffs import SignoffRenderer, SimpleSignoff

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ per-file-ignores =
signoffs/forms.py: F401
signoffs/models.py: F401
signoffs/process.py: F401
signoffs/signing_order.py: F401
signoffs/signoffs.py: F401
signoffs/core/utils.py: C901

0 comments on commit dd1dfe7

Please sign in to comment.