Skip to content

Commit

Permalink
Merge pull request #352 from sanger/develop
Browse files Browse the repository at this point in the history
Develop into master
  • Loading branch information
yoldas committed Mar 22, 2024
2 parents 6264bf6 + 0c5f782 commit b3ace55
Show file tree
Hide file tree
Showing 11 changed files with 788 additions and 1,222 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ updates:
time: "07:00"
timezone: Europe/London
open-pull-requests-limit: 10
labels:
- "dependencies"
- "Technical Debt"
- "python"

34 changes: 22 additions & 12 deletions .github/workflows/automated_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ jobs:
docker.pkg.github.com/${IMAGE_NAME}:${BRANCH_NAME}
python -m pytest --no-cov -vx
- name: Set release tag
- name: Set release name
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# On the develop branch this might create RELEASE_VERSION=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_VERSION=2.4.6
run: echo "RELEASE_VERSION=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV
# On the develop branch this might create RELEASE_NAME=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_NAME=2.4.6
run: echo "RELEASE_NAME=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV

- name: Set release tag
run: echo "RELEASE_TAG=v$RELEASE_NAME" >> $GITHUB_ENV

- name: Create release
uses: ncipollo/release-action@v1.8.8
with:
name: ${{ env.RELEASE_VERSION }}
tag: v${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_NAME }}
tag: ${{ env.RELEASE_TAG }}
prerelease: ${{ !(github.ref == 'refs/heads/master') }}
commit: ${{ github.sha }}

Expand All @@ -57,14 +60,21 @@ jobs:
run: >-
docker tag
docker.pkg.github.com/${IMAGE_NAME}:${BRANCH_NAME}
docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_VERSION }}
docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_TAG }}
- name: Push release tag image to registry
run: >-
docker push docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_VERSION }}
docker push docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_TAG }}
- name: Remove the oldest package
uses: actions/delete-package-versions@v1
if: false
- name: Remove old releases
uses: snok/container-retention-policy@v2
with:
package-name: "${{ github.event.repository.name }}"
image-names: ${{ github.event.repository.name }}/*
cut-off: Four months ago UTC
timestamp-to-use: updated_at
account-type: org
org-name: sanger
keep-at-least: 5
skip-tags: latest
token: ${{ secrets.REMOVE_OLD_IMAGES }}

2 changes: 1 addition & 1 deletion .github/workflows/check_release_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v23
uses: tj-actions/changed-files@v41
with:
files: |
.release-version
Expand Down
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.3
1.3.4
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"python.analysis.typeCheckingMode": "basic",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
}
}
695 changes: 21 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
black = "==22.10.0"
black = "==24.3.0"
coverage = {extras = ["toml"],version = "*"}
flake8 = "*"
flake8-bugbear = "*"
Expand All @@ -13,12 +13,12 @@ pytest = "*"
pytest-cov = "*"

[packages]
colorlog = "~=6.7"
flask = "~=2.0"
gunicorn = "~=20.0"
python-dotenv = "~=0.21"
colorlog = "~=6.8"
flask = "~=3.0"
gunicorn = "~=21.2"
python-dotenv = "~=1.0"
slackclient = "~=2.6"
markupsafe = "==2.1.1"
markupsafe = "==2.1.5"
click = "~=8.0"
types-flask = "*"

Expand Down
1,249 changes: 725 additions & 524 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/helpers/test_rack_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def test_parse_tube_rack_csv(app):

def test_parse_tube_rack_csv_ignores_no_read(app, client, tmpdir):
with app.app_context():

expected_output = {
"rack_barcode": "DN_48_no_read",
"layout": {"FR05653780": "A1", "FR05653808": "A2", "FR05653801": "F8"},
Expand Down
3 changes: 2 additions & 1 deletion wrangler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import logging
import logging.config
from http import HTTPStatus
from typing import Optional

from flask import Flask

logger = logging.getLogger(__name__)


def create_app(test_config_path: str = None) -> Flask:
def create_app(test_config_path: Optional[str] = None) -> Flask:
app = Flask(__name__, instance_relative_config=False)

if test_config_path is None:
Expand Down
5 changes: 4 additions & 1 deletion wrangler/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import Optional


class Error(Exception):
"""Base class for exceptions in this module."""

pass


class CsvNotFoundError(Error):
def __init__(self, tube_rack_barcode: str, message: str = None):
def __init__(self, tube_rack_barcode: str, message: Optional[str] = None):
"""Raised when a CSV file named after a tube rack barcode is not found in the NFS.
Arguments:
Expand Down

0 comments on commit b3ace55

Please sign in to comment.