Skip to content

Commit

Permalink
Merge branch 'release/0.3.76' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Feb 11, 2024
2 parents a234faf + 2000b01 commit edd414d
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
sudo apt-get -y update
sudo apt-get install libcups2-dev wamerican
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -48,7 +48,7 @@ jobs:
echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ exclude: tests/etc/user-*

repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.7.7
hooks:
- id: bandit
args:
- "-x *test*.py"

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.1.1
hooks:
- id: black
language_version: python3.10
language_version: python3.11

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
args:
- "--config=setup.cfg"

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: requirements-txt-fixer
files: requirements/.*\.txt$
Expand All @@ -42,7 +42,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: v1.31.0
rev: v1.33.0
hooks:
- id: yamllint
args:
Expand Down
6 changes: 3 additions & 3 deletions edc_action_item/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def __init__(
if not self.related_action_item and self.related_reference_fk_attr:
raise ActionError(
"Action class expects a related_action_item. "
f"related_reference_fk_attr={self.related_reference_fk_attr}. "
f"Got None for action based on action_item {self.action_item}. "
f"See {repr(self)}"
f"related_reference_fk_attr=`{self.related_reference_fk_attr}`. "
f"Got None for action based on action_item `{self.action_item}`. "
f"See `{repr(self)}`"
)

if self.reference_obj and not self.readonly:
Expand Down
1 change: 0 additions & 1 deletion edc_action_item/action_with_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class ActionWithNotification(Action):

"""A class mixin for the Action class that adds
support for notifications.
"""
Expand Down
1 change: 0 additions & 1 deletion edc_action_item/forms/action_item_crf_form_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class ActionItemCrfFormMixin:

"""Declare with forms.ModelForm."""

class Meta:
Expand Down
2 changes: 0 additions & 2 deletions edc_action_item/forms/action_item_form_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class ActionItemFormMixin:

"""Declare with forms.ModelForm."""

class Meta:
Expand All @@ -14,7 +13,6 @@ class Meta:


class ActionItemCrfFormMixin:

"""Declare with forms.ModelForm."""

class Meta:
Expand Down
3 changes: 1 addition & 2 deletions edc_action_item/models/action_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class PrnModel(BaseUuidModel):
subject_identifier: str
...

class CrfModel(CrfModelMixin):
...
class CrfModel(CrfModelMixin): ...


class CurrentSiteManager(BaseCurrentSiteManager):
Expand Down
1 change: 0 additions & 1 deletion edc_action_item/models/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def get_by_natural_key(self, action_identifier):


class Reference(NonUniqueSubjectIdentifierFieldMixin, ActionModelMixin, BaseUuidModel):

"""Model used as a default reference model for simple actions
not created by another model.
Expand Down
9 changes: 3 additions & 6 deletions edc_action_item/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def __init__(
related_action_item: Optional["ActionItemStub"] = None,
using: Optional[str] = None,
readonly: Optional[bool] = None,
) -> None:
...
) -> None: ...

name: str
action_item: "ActionItemStub"
Expand Down Expand Up @@ -52,11 +51,9 @@ class ActionItemStub(Protocol):

action_cls: ActionStub

def get_status_display(self) -> str:
...
def get_status_display(self) -> str: ...

def get_action_cls(self) -> Type[ActionStub]:
...
def get_action_cls(self) -> Type[ActionStub]: ...


class ActionItemWithNotificationStub(ActionItemStub, Protocol):
Expand Down
9 changes: 3 additions & 6 deletions edc_action_item/view_utils/action_item_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ class ActionItemButton(ModelButton):

@property
def label(self) -> str | None:
label = (
self.fixed_label
if self.fixed_label
else self.action_cls.reference_model_cls()._meta.verbose_name
)
return f"Add {label}"
if self.fixed_label:
return self.fixed_label
return self.action_cls.reference_model_cls()._meta.verbose_name

@property
def site(self) -> Site | None:
Expand Down
3 changes: 1 addition & 2 deletions edc_action_item/view_utils/action_item_popover_list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class PrnModel(BaseUuidModel):
subject_identifier: str
...

class CrfModel(CrfModelMixin):
...
class CrfModel(CrfModelMixin): ...


@dataclass
Expand Down
1 change: 0 additions & 1 deletion edc_action_item/visit_schedule_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class VisitScheduleActionMixin:

"""A mixin for the Action class to add properties and
methods related to the visit schedule from
edc_visit_schedule.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exclude =
edc_action_item.tests*

[flake8]
ignore = E226,W503,E203
ignore = E226,W503,E203,E701,E704
max-line-length = 95
max-complexity = 10
exclude = */migrations/*,.tox,.git,__pycache__,build,dist,.eggs
Expand Down

0 comments on commit edd414d

Please sign in to comment.