Skip to content

Commit

Permalink
Merge branch 'release/0.3.57' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Mar 1, 2024
2 parents 77603eb + 58bc172 commit 97b9585
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 32 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
12 changes: 6 additions & 6 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.9.1
rev: 24.2.0
hooks:
- id: black
language_version: python3.11

- repo: https://github.com/pycqa/flake8
rev: 6.1.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.32.0
rev: v1.34.0
hooks:
- id: yamllint
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class CrfRequisitionFormValidatorMixin:

"""An FormValidator mixin for CRFs (not requisitions).
Used with a CRF that refers to a requisition or requisitions.
Expand Down
1 change: 0 additions & 1 deletion edc_lab/identifiers/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class PrefixKeyError(Exception):


class Prefix:

"""A class to generate an identifier prefix."""

template: str = "{protocol_number}{requisition_identifier}"
Expand Down
1 change: 0 additions & 1 deletion edc_lab/lab/aliquot_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class AliquotTypeNumericCodeError(Exception):


class AliquotType:

"""A class to represent an aliquot type by an alpha and
numeric code.
Expand Down
1 change: 0 additions & 1 deletion edc_lab/lab/lab_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class LabProfileRequisitionModelError(Exception):


class LabProfile:

"""A container class for aliquot types, panels and processing."""

site_model = "sites.site"
Expand Down
1 change: 0 additions & 1 deletion edc_lab/lab/primary_aliquot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class PrimaryAliquotPrefixError(Exception):


class PrimaryAliquot:

"""A class that gets or creates the primary aliquot."""

def __init__(
Expand Down
2 changes: 0 additions & 2 deletions edc_lab/lab/processing_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class ProcessingProfileAlreadyAdded(Exception):


class Process:

"""A class to represent the resulting aliquot type and number of
aliquots from the processing of a source aliquot.
"""
Expand All @@ -28,7 +27,6 @@ def __str__(self):


class ProcessingProfile:

"""A container of process instances.
Given a source aliquot, all processes in the profile
Expand Down
2 changes: 0 additions & 2 deletions edc_lab/lab/requisition_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class InvalidProcessingProfile(Exception):


class PanelAttrs:

""" "A simple class of panel name attributes."""

def __init__(self, name: str = None, alpha_code: str = None) -> None:
Expand All @@ -32,7 +31,6 @@ def __init__(self, name: str = None, alpha_code: str = None) -> None:


class RequisitionPanel:

"""A panel class that contains processing profile instances."""

panel_attrs_cls = PanelAttrs
Expand Down
1 change: 0 additions & 1 deletion edc_lab/lab/specimen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class SpecimenNotDrawnError(Exception):


class Specimen:

"""A class that represents a collected specimen and it's aliquots
given the original requisition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class CrfWithRequisitionModelMixin(models.Model):

"""You may also wish to override field `requisition`
to include `limit_choices_to`.
Expand Down
19 changes: 11 additions & 8 deletions edc_lab/pdf_reports/manifest_pdf_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

from ..model_mixins import ManifestModelMixin

class Model(PdfReportModelMixin, ManifestModelMixin, BaseUuidModel):
...
class Model(PdfReportModelMixin, ManifestModelMixin, BaseUuidModel): ...


class ManifestPdfReportError(Exception):
Expand Down Expand Up @@ -252,9 +251,11 @@ def get_report_story(self, **kwargs):
Paragraph(self.contact_name, self.styles["line_data_large"]),
"",
Paragraph(
self.manifest.export_datetime.strftime("%Y-%m-%d %H:%M")
if self.manifest.shipped
else "PREVIEW",
(
self.manifest.export_datetime.strftime("%Y-%m-%d %H:%M")
if self.manifest.shipped
else "PREVIEW"
),
self.styles["line_data_large"],
),
],
Expand Down Expand Up @@ -327,9 +328,11 @@ def formatted_address(self, **kwargs):
data.get("contact_name"),
data.get("name"),
data.get("address"),
data.get("city")
if not data.get("state")
else "{} {}".format(data.get("city"), data.get("state")),
(
data.get("city")
if not data.get("state")
else "{} {}".format(data.get("city"), data.get("state"))
),
data.get("postal_code"),
data.get("country"),
]
Expand Down
3 changes: 1 addition & 2 deletions edc_lab/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ class AliquotTypeStub(Protocol):
alpha_code: str
numeric_code: str

def add_derivatives(self: "AliquotTypeStub") -> None:
...
def add_derivatives(self: "AliquotTypeStub") -> None: ...
3 changes: 2 additions & 1 deletion edc_lab/tests/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,6 @@ class Meta:
form.is_valid()
self.assertIn("requisition_datetime", form._errors)
self.assertIn(
"Invalid. Expected a date/time between", form.errors.get("requisition_datetime")[0]
"Invalid. Date falls outside of the window period",
form.errors.get("requisition_datetime")[0],
)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exclude =
edc_lab.tests*

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

0 comments on commit 97b9585

Please sign in to comment.