Skip to content

Commit

Permalink
Updated actions, removed flake8, fixed unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Apr 26, 2024
1 parent d721a95 commit 7926afb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
16 changes: 4 additions & 12 deletions import_specifications/clients/baseclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,15 @@ def _get_token(user_id, password, auth_svc):
tok = _json.loads(ret.text)
elif status == 403:
raise Exception(
"Authentication failed: Bad user_id/password "
+ "combination for user %s" % (user_id)
"Authentication failed: Bad user_id/password " + "combination for user %s" % (user_id)
)
else:
raise Exception(ret.text)
return tok["token"]


def _read_inifile(
file=_os.environ.get(
"KB_DEPLOYMENT_CONFIG", _os.environ["HOME"] + "/.kbase_config"
),
file=_os.environ.get("KB_DEPLOYMENT_CONFIG", _os.environ["HOME"] + "/.kbase_config"),
): # @ReservedAssignment
# Another bandaid to read in the ~/.kbase_config file if one is present
authdata = None
Expand Down Expand Up @@ -102,9 +99,7 @@ def __init__(self, name, code, message, data=None, error=None):
# data = JSON RPC 2.0, error = 1.1

def __str__(self):
return (
self.name + ": " + str(self.code) + ". " + self.message + "\n" + self.data
)
return self.name + ": " + str(self.code) + ". " + self.message + "\n" + self.data


class _JSONObjectEncoder(_json.JSONEncoder):
Expand Down Expand Up @@ -181,10 +176,7 @@ def __init__(
if authdata is not None:
if authdata.get("token") is not None:
self._headers["AUTHORIZATION"] = authdata["token"]
elif (
authdata.get("user_id") is not None
and authdata.get("password") is not None
):
elif authdata.get("user_id") is not None and authdata.get("password") is not None:
self._headers["AUTHORIZATION"] = _get_token(
authdata["user_id"], authdata["password"], auth_svc
)
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ line-length = 100


[tool.ruff]
select = [
lint.select = [
# core
"F", # Pyflakes
"E", # pycodestyle errors
Expand All @@ -27,15 +27,15 @@ select = [
# E203: whitespace before ‘,’, ‘;’, or ‘:’
# E501: line length
# W503: line break after binary operator
ignore = [
lint.ignore = [
"E203",
"E501",
"S101",
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
lint.fixable = ["ALL"]
lint.unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down Expand Up @@ -67,7 +67,7 @@ exclude = [
"sample_data",
"venv",
]
per-file-ignores = { }
lint.per-file-ignores = { }

# Same as Black.
line-length = 100
Expand Down
6 changes: 5 additions & 1 deletion staging_service/autodetect/GenerateMappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@
fastq_reads_interleaved_id,
fastq_reads_noninterleaved_id,
]
file_format_to_app_mapping[FASTA] = [assembly_id, gff_genome_id, gff_metagenome_id]
file_format_to_app_mapping[FASTA] = [
assembly_id,
gff_genome_id,
gff_metagenome_id,
]
file_format_to_app_mapping[GENBANK] = [genbank_genome_id]
file_format_to_app_mapping[GFF] = [gff_genome_id, gff_metagenome_id]
file_format_to_app_mapping[ZIP] = [decompress_id]
Expand Down

0 comments on commit 7926afb

Please sign in to comment.