Skip to content

Commit

Permalink
Merge pull request #883 from sanger/dependabot/pip/black-24.2.0
Browse files Browse the repository at this point in the history
Bump black from 23.12.1 to 24.2.0
  • Loading branch information
yoldas authored Mar 7, 2024
2 parents d271e2d + e4b1087 commit a82f144
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 82 deletions.
122 changes: 91 additions & 31 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 43 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,31 @@ mongodb by the [crawler](https://github.com/sanger/crawler).

<!-- toc -->

- [Lighthouse service](#lighthouse-service)
- [Table of Contents](#table-of-contents)
- [A note on Docker](#a-note-on-docker)
- [Option A - using Docker](#option-a---using-docker)
- [Requirements for Development](#requirements-for-development)
- [Getting Started](#getting-started)
- [Configuring the Environment](#configuring-the-environment)
- [Setup Steps](#setup-steps)
- [Running](#running)
- [Testing](#testing)
- [Option B - without Docker](#option-b---without-docker)
- [Requirements for Development](#requirements-for-development-1)
- [Getting Started](#getting-started-1)
- [Configuring the Environment](#configuring-the-environment-1)
- [Setup Steps](#setup-steps-1)
- [Running](#running-1)
- [Testing](#testing-1)
- [Testing Requirements](#testing-requirements)
- [Running Tests](#running-tests)
- [Deployment](#deployment)
- [Routes](#routes)
- [Scheduled Jobs](#scheduled-jobs)
- [Miscellaneous](#miscellaneous)
- [Type Checking](#type-checking)
- [Troubleshooting](#troubleshooting)
- [pyodbc Errors](#pyodbc-errors)
- [Updating the Table of Contents](#updating-the-table-of-contents)
- [A note on Docker](#a-note-on-docker)
- [Option A - using Docker](#option-a---using-docker)
- [Requirements for Development](#requirements-for-development)
- [Getting Started](#getting-started)
- [Configuring the Environment](#configuring-the-environment)
- [Setup Steps](#setup-steps)
- [Running](#running)
- [Testing](#testing)
- [Option B - without Docker](#option-b---without-docker)
- [Requirements for Development](#requirements-for-development-1)
- [Getting Started](#getting-started-1)
- [Configuring the Environment](#configuring-the-environment-1)
- [Setup Steps](#setup-steps-1)
- [Running](#running-1)
- [Testing](#testing-1)
- [Testing Requirements](#testing-requirements)
- [Running Tests](#running-tests)
- [Formatting, Type Checking and Linting](#formatting-type-checking-and-linting)
- [Deployment](#deployment)
- [Routes](#routes)
- [Scheduled Jobs](#scheduled-jobs)
- [Miscellaneous](#miscellaneous)
- [Troubleshooting](#troubleshooting)
- [pyodbc Errors](#pyodbc-errors)
- [Updating the Table of Contents](#updating-the-table-of-contents)

<!-- tocstop -->

Expand Down Expand Up @@ -202,6 +200,24 @@ A wrapper is provided with pipenv (look in the Pipfile's `[scripts]` block for m

**NB**: Make sure to be in the virtual environment (`pipenv shell`) before running the tests.

### Formatting, Type Checking and Linting

Black is used as a formatter, to format code before committing:

black .

Mypy is used as a type checker, to execute:

mypy .

Flake8 is used for linting, to execute:

flake8

A little convenience script can be used to run the formatting, type checking and linting:

./forlint.sh

## Deployment

This project uses a Docker image as the unit of deployment. Update `.release-version` with
Expand Down Expand Up @@ -247,12 +263,6 @@ It is disabled by default. The config for the job can be found in `config/defaul

## Miscellaneous

### Type Checking

Type checking is done using mypy, to run it, execute:

mypy .

### Troubleshooting

#### pyodbc Errors
Expand Down
12 changes: 6 additions & 6 deletions lighthouse/constants/error_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
ERROR_CHERRYPICKED_CREATE: Final[str] = "Failed to create a cherrypicked plate in Sequencescape:"


ERROR_UNEXPECTED_CHERRYPICKING_CREATE: Final[
str
] = f"{ERROR_UNEXPECTED} attempting to create a cherrypicked plate in Sequencescape:"
ERROR_UNEXPECTED_CHERRYPICKING_FAILURE: Final[
str
] = f"{ERROR_UNEXPECTED} attempting to record cherrypicking plate failure"
ERROR_UNEXPECTED_CHERRYPICKING_CREATE: Final[str] = (
f"{ERROR_UNEXPECTED} attempting to create a cherrypicked plate in Sequencescape:"
)
ERROR_UNEXPECTED_CHERRYPICKING_FAILURE: Final[str] = (
f"{ERROR_UNEXPECTED} attempting to record cherrypicking plate failure"
)

ERROR_SAMPLE_DATA_MISMATCH: Final[str] = "Mismatch in destination and source sample data for plate: "
ERROR_SAMPLE_DATA_MISSING: Final[str] = "Failed to find sample data in DART for plate barcode: "
Expand Down
18 changes: 6 additions & 12 deletions lighthouse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,21 @@


class EventPropertyProtocol(Protocol):
def get_param_value(self, param_name: str) -> Optional[Any]:
...
def get_param_value(self, param_name: str) -> Optional[Any]: ...

def process_validation(self, condition: bool, message: str) -> None:
...
def process_validation(self, condition: bool, message: str) -> None: ...

def validation_scope(self):
...
def validation_scope(self): ...


class PlateEvent(Protocol):
"""This class is used to assist the mixin while type checking."""

@property
def properties(self) -> Dict[str, Any]:
...
def properties(self) -> Dict[str, Any]: ...

@property
def plate_barcode(self) -> str:
...
def plate_barcode(self) -> str: ...

@property
def robot_serial_number(self) -> str:
...
def robot_serial_number(self) -> str: ...

0 comments on commit a82f144

Please sign in to comment.