From 3e30278f3442aa28704f0210493046197f93a54d Mon Sep 17 00:00:00 2001 From: Mike Hemesath Date: Tue, 29 Aug 2023 17:32:10 -0500 Subject: [PATCH] Fixed linting errors --- omics/rerun/omics-rerun | 15 ++++++++------- omics/uriparse/uri_parse.py | 7 ++++++- tests/uriparse/unit/test_uri_parse.py | 8 ++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/omics/rerun/omics-rerun b/omics/rerun/omics-rerun index 7a725cb..a198642 100755 --- a/omics/rerun/omics-rerun +++ b/omics/rerun/omics-rerun @@ -53,15 +53,16 @@ Examples: omics-rerun -d 1234567 """ import datetime -import dateutil -import botocore -import docopt -import boto3 -import time import json -import sys -import re import os +import re +import sys +import time + +import boto3 +import botocore +import dateutil +import docopt exename = os.path.basename(sys.argv[0]) diff --git a/omics/uriparse/uri_parse.py b/omics/uriparse/uri_parse.py index f9da3fb..d926c35 100644 --- a/omics/uriparse/uri_parse.py +++ b/omics/uriparse/uri_parse.py @@ -2,7 +2,11 @@ import re -from omics.common.omics_file_types import OMICS_URI_TYPE_FILENAME_MAP, OMICS_URI_TYPE_DEFAULT_FILENAME_MAP, OmicsFileType +from omics.common.omics_file_types import ( + OMICS_URI_TYPE_DEFAULT_FILENAME_MAP, + OMICS_URI_TYPE_FILENAME_MAP, + OmicsFileType, +) class OmicsUri: @@ -14,6 +18,7 @@ class OmicsUri: ex: omics://429915189008.storage.us-east-1.amazonaws.com/1981413158/readSet/5346184667/source1 ex: omics://429915189008.storage.us-east-1.amazonaws.com/1981413158/reference/5346184667/source """ + URI_REGEX = r"omics://(\d{10,12})\.storage\.([a-z]{2}-[a-z-]{4,}-\d+)\.amazonaws\.com/(\d{10,36})/(readSet|reference)/(\d{10,36})(/(source[12]?|index))?$" def __init__(self, omics_uri): diff --git a/tests/uriparse/unit/test_uri_parse.py b/tests/uriparse/unit/test_uri_parse.py index 07581de..2decf18 100644 --- a/tests/uriparse/unit/test_uri_parse.py +++ b/tests/uriparse/unit/test_uri_parse.py @@ -1,8 +1,12 @@ import unittest from omics.uriparse.uri_parse import OmicsUri, OmicsUriParser -from tests.uriparse import VALID_READSET_URI, VALID_REFERENCE_URI -from tests.uriparse import VALID_READSET_DEFAULT_FILE_URI, VALID_REFERENCE_DEFAULT_FILE_URI +from tests.uriparse import ( + VALID_READSET_DEFAULT_FILE_URI, + VALID_READSET_URI, + VALID_REFERENCE_DEFAULT_FILE_URI, + VALID_REFERENCE_URI, +) class UriParserTest(unittest.TestCase):