mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 07:19:13 +08:00
Update to black 2024 stable style
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
# E203 is whitespace before ':'; we follow black's formatting here. See https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated
|
||||
# E402 module level import not at top of file # TODO, we would like to improve this.
|
||||
# E501 is line length (delegated to black)
|
||||
# E701,E704 are multiple statements on one line; we follow black's formatting here. See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#configuration
|
||||
# W503 is line breaks before binary operators, which has been reversed in PEP 8.
|
||||
# D** are docstring linting - which we mostly ignore except D302. (Hopefully we will solve more over time).
|
||||
ignore = B008,E203,E402,E501,W503,D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D204,D205,D206,D207,D208,D209,D210,D211,D300,D301,D400,D401,D402,D403,D412,D413
|
||||
ignore = B008,E203,E402,E501,E701,E704,W503,D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D204,D205,D206,D207,D208,D209,D210,D211,D300,D301,D400,D401,D402,D403,D412,D413
|
||||
exclude = lib/tool_shed/test/test_data/repos
|
||||
|
||||
@@ -55,6 +55,4 @@ jobs:
|
||||
- name: Run mypy checks
|
||||
run: tox -e mypy
|
||||
- uses: psf/black@stable
|
||||
with:
|
||||
version: "23.3.0"
|
||||
- uses: isort/isort-action@master
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Contains library functions
|
||||
"""
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os.path
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Mock infrastructure for testing ModelManagers.
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Contains implementations of the authentication logic.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from galaxy.auth.util import (
|
||||
|
||||
@@ -3,6 +3,7 @@ Created on 15/07/2014
|
||||
|
||||
@author: Andrew Robinson
|
||||
"""
|
||||
|
||||
import abc
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Created on 16/07/2014
|
||||
|
||||
@author: Andrew Robinson
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from . import AuthProvider
|
||||
|
||||
@@ -89,7 +89,6 @@ def _parse_ldap_options(options_unparsed):
|
||||
|
||||
|
||||
class LDAP(AuthProvider):
|
||||
|
||||
"""
|
||||
Attempts to authenticate users against an LDAP server.
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Created on 16/07/2014
|
||||
|
||||
@author: Andrew Robinson
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from . import AuthProvider
|
||||
|
||||
@@ -3,6 +3,7 @@ Created on 13/07/2015
|
||||
|
||||
Author Peter van Heusden (pvh@sanbi.ac.za)
|
||||
"""
|
||||
|
||||
import logging
|
||||
import shlex
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Universe configuration builder.
|
||||
"""
|
||||
|
||||
# absolute_import needed for tool_shed package.
|
||||
|
||||
import configparser
|
||||
@@ -231,9 +232,9 @@ class BaseAppConfiguration(HasDynamicProperties):
|
||||
# If VALUE == first directory in a user-supplied path that resolves to KEY, it will be stripped from that path
|
||||
renamed_options: Optional[Dict[str, str]] = None
|
||||
deprecated_dirs: Dict[str, str] = {}
|
||||
paths_to_check_against_root: Set[
|
||||
str
|
||||
] = set() # backward compatibility: if resolved path doesn't exist, try resolving w.r.t root
|
||||
paths_to_check_against_root: Set[str] = (
|
||||
set()
|
||||
) # backward compatibility: if resolved path doesn't exist, try resolving w.r.t root
|
||||
add_sample_file_to_defaults: Set[str] = set() # for these options, add sample config files to their defaults
|
||||
listify_options: Set[str] = set() # values for these options are processed as lists of values
|
||||
object_store_store_by: str
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Datatypes for Anvi'o
|
||||
https://github.com/merenlab/anvio
|
||||
"""
|
||||
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
External datatypes may make use of these functions.
|
||||
"""
|
||||
|
||||
from galaxy.util.checkers import (
|
||||
check_binary,
|
||||
check_bz2,
|
||||
|
||||
@@ -193,6 +193,7 @@ class Vtk:
|
||||
TODO: only legacy formats are currently supported and support for XML formats
|
||||
should be added.
|
||||
"""
|
||||
|
||||
subtype = ""
|
||||
# Add metadata elements.
|
||||
MetadataElement(name="vtk_version", default=None, desc="Vtk version", readonly=True, optional=True, visible=True)
|
||||
|
||||
@@ -13,6 +13,7 @@ where location is formatted as:
|
||||
|
||||
and symbols are sorted in lexigraphical order.
|
||||
"""
|
||||
|
||||
import optparse
|
||||
|
||||
from bx.tabular.io import (
|
||||
|
||||
@@ -425,9 +425,9 @@ class Data(metaclass=DataMeta):
|
||||
self, dataset: DatasetHasHidProtocol, to_ext: Optional[str], headers: Headers, **kwd
|
||||
) -> Tuple[IO, Headers]:
|
||||
headers["Content-Length"] = str(os.stat(dataset.get_file_name()).st_size)
|
||||
headers[
|
||||
"content-type"
|
||||
] = "application/octet-stream" # force octet-stream so Safari doesn't append mime extensions to filename
|
||||
headers["content-type"] = (
|
||||
"application/octet-stream" # force octet-stream so Safari doesn't append mime extensions to filename
|
||||
)
|
||||
filename = self._download_filename(
|
||||
dataset,
|
||||
to_ext,
|
||||
@@ -476,9 +476,9 @@ class Data(metaclass=DataMeta):
|
||||
element_identifier=kwd.get("element_identifier"),
|
||||
filename_pattern=kwd.get("filename_pattern"),
|
||||
)
|
||||
headers[
|
||||
"content-type"
|
||||
] = "application/octet-stream" # force octet-stream so Safari doesn't append mime extensions to filename
|
||||
headers["content-type"] = (
|
||||
"application/octet-stream" # force octet-stream so Safari doesn't append mime extensions to filename
|
||||
)
|
||||
headers["Content-Disposition"] = f'attachment; filename="{filename}"'
|
||||
return open(data.get_file_name(), "rb"), headers
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Base class(es) for all DataProviders.
|
||||
"""
|
||||
|
||||
# there's a blurry line between functionality here and functionality in datatypes module
|
||||
# attempting to keep parsing to a minimum here and focus on chopping/pagination/reformat(/filtering-maybe?)
|
||||
# and using as much pre-computed info/metadata from the datatypes module as possible
|
||||
|
||||
@@ -4,6 +4,7 @@ Chunk (N number of bytes at M offset to a source's beginning) provider.
|
||||
Primarily for file sources but usable by any iterator that has both
|
||||
seek and read( N ).
|
||||
"""
|
||||
|
||||
import base64
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Providers that provide lists of lists generally where each line of a source
|
||||
is further subdivided into multiple data (e.g. columns from a line).
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from urllib.parse import unquote_plus
|
||||
|
||||
@@ -5,6 +5,7 @@ Dataproviders that use either:
|
||||
- or provide data in some way relevant to bioinformatic data
|
||||
(e.g. parsing genomic regions from their source)
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Data providers that iterate over a source that is not in memory
|
||||
or not in a file.
|
||||
"""
|
||||
|
||||
import gzip
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Dataproviders that iterate over lines from their sources.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from galaxy.util import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Dataproviders that iterate over lines from their sources.
|
||||
"""
|
||||
|
||||
import collections
|
||||
import logging
|
||||
import re
|
||||
|
||||
@@ -11,6 +11,7 @@ subsequent row values are all numeric ! Will fail if any non numeric (eg '+' or
|
||||
ross lazarus for rgenetics
|
||||
august 20 2007
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
GIS classes
|
||||
"""
|
||||
|
||||
from galaxy.datatypes.binary import Binary
|
||||
from galaxy.datatypes.protocols import (
|
||||
DatasetProtocol,
|
||||
|
||||
@@ -365,7 +365,6 @@ class AGPLine(metaclass=abc.ABCMeta):
|
||||
|
||||
|
||||
class AGPSeqLine(AGPLine):
|
||||
|
||||
"""
|
||||
A subclass of AGPLine specifically for AGP lines that represent sequences.
|
||||
"""
|
||||
@@ -462,7 +461,6 @@ class AGPSeqLine(AGPLine):
|
||||
|
||||
|
||||
class AGPGapLine(AGPLine):
|
||||
|
||||
"""
|
||||
A subclass of AGPLine specifically for AGP lines that represent sequence gaps.
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Graph content classes.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
This datatype was created for use with the iSEE interactive tool.
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from galaxy.datatypes.data import Data
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Image classes
|
||||
"""
|
||||
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Interval datatypes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Video classes"""
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import wave
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Mothur Metagenomics Datatypes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Neo4j Composite Dataset
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from galaxy.datatypes.data import Data
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
NGS indexes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ Created on January. 05, 2018
|
||||
@githuborganization: C3BI
|
||||
Phylip datatype sniffer
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from galaxy import util
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Proteomics Datatypes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import (
|
||||
|
||||
@@ -1,37 +1,33 @@
|
||||
"""
|
||||
Location of protocols used in datatypes
|
||||
"""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typing_extensions import Protocol
|
||||
|
||||
|
||||
class HasClearAssociatedFiles(Protocol):
|
||||
def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None:
|
||||
...
|
||||
def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ...
|
||||
|
||||
|
||||
class HasCreatingJob(Protocol):
|
||||
@property
|
||||
def creating_job(self):
|
||||
...
|
||||
def creating_job(self): ...
|
||||
|
||||
|
||||
class HasExt(Protocol):
|
||||
@property
|
||||
def ext(self):
|
||||
...
|
||||
def ext(self): ...
|
||||
|
||||
|
||||
class HasExtraFilesPath(Protocol):
|
||||
@property
|
||||
def extra_files_path(self):
|
||||
...
|
||||
def extra_files_path(self): ...
|
||||
|
||||
|
||||
class HasFileName(Protocol):
|
||||
def get_file_name(self, sync_cache=True) -> str:
|
||||
...
|
||||
def get_file_name(self, sync_cache=True) -> str: ...
|
||||
|
||||
|
||||
class HasHid(Protocol):
|
||||
@@ -54,8 +50,7 @@ class HasName(Protocol):
|
||||
name: str
|
||||
|
||||
|
||||
class HasExtraFilesAndMetadata(HasExtraFilesPath, HasMetadata, Protocol):
|
||||
...
|
||||
class HasExtraFilesAndMetadata(HasExtraFilesPath, HasMetadata, Protocol): ...
|
||||
|
||||
|
||||
class DatasetProtocol(
|
||||
@@ -78,24 +73,17 @@ class DatasetProtocol(
|
||||
states: Any
|
||||
|
||||
@property
|
||||
def datatype(self):
|
||||
...
|
||||
def datatype(self): ...
|
||||
|
||||
def get_converted_files_by_type(self, file_type):
|
||||
...
|
||||
def get_converted_files_by_type(self, file_type): ...
|
||||
|
||||
def get_mime(self) -> str:
|
||||
...
|
||||
def get_mime(self) -> str: ...
|
||||
|
||||
def get_size(self) -> int:
|
||||
...
|
||||
def get_size(self) -> int: ...
|
||||
|
||||
def has_data(self) -> bool:
|
||||
...
|
||||
def has_data(self) -> bool: ...
|
||||
|
||||
def set_peek(self) -> None:
|
||||
...
|
||||
def set_peek(self) -> None: ...
|
||||
|
||||
|
||||
class DatasetHasHidProtocol(DatasetProtocol, HasHid, Protocol):
|
||||
...
|
||||
class DatasetHasHidProtocol(DatasetProtocol, HasHid, Protocol): ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Qualityscore class
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from galaxy.datatypes.protocols import DatasetProtocol
|
||||
|
||||
@@ -356,9 +356,9 @@ class Registry:
|
||||
compressed_datatype_instance = compressed_datatype_class()
|
||||
self.datatypes_by_extension[compressed_extension] = compressed_datatype_instance
|
||||
for suffix in infer_from_suffixes:
|
||||
self.datatypes_by_suffix_inferences[
|
||||
f"{suffix}.{auto_compressed_type}"
|
||||
] = compressed_datatype_instance
|
||||
self.datatypes_by_suffix_inferences[f"{suffix}.{auto_compressed_type}"] = (
|
||||
compressed_datatype_instance
|
||||
)
|
||||
if display_in_upload and compressed_extension not in self.upload_file_formats:
|
||||
self.upload_file_formats.append(compressed_extension)
|
||||
self.datatype_info_dicts.append(
|
||||
|
||||
@@ -91,8 +91,7 @@ class ConvertResult(NamedTuple):
|
||||
class ConvertFunction(Protocol):
|
||||
def __call__(
|
||||
self, fname: str, in_place: bool = True, tmp_dir: Optional[str] = None, tmp_prefix: Optional[str] = "gxupload"
|
||||
) -> ConvertResult:
|
||||
...
|
||||
) -> ConvertResult: ...
|
||||
|
||||
|
||||
def convert_newlines(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Datatype classes for tracks/track views within galaxy.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from galaxy.datatypes.protocols import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Triple format classes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Provides utilities for working with GFF files.
|
||||
"""
|
||||
|
||||
import copy
|
||||
|
||||
from bx.intervals.io import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
XML format classes
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
@@ -11,7 +11,7 @@ babel==2.14.0 ; python_version >= "3.8" and python_version < "3.13"
|
||||
backports-zoneinfo==0.2.1 ; python_version >= "3.8" and python_version < "3.9"
|
||||
backports-zoneinfo[tzdata]==0.2.1 ; python_version >= "3.8" and python_version < "3.9"
|
||||
billiard==4.2.0 ; python_version >= "3.8" and python_version < "3.13"
|
||||
black==24.1.0 ; python_version >= "3.8" and python_version < "3.13"
|
||||
black==24.1.1 ; python_version >= "3.8" and python_version < "3.13"
|
||||
build==1.0.3 ; python_version >= "3.8" and python_version < "3.13"
|
||||
cachecontrol[filecache]==0.13.1 ; python_version >= "3.8" and python_version < "3.13"
|
||||
celery==5.3.6 ; python_version >= "3.8" and python_version < "3.13"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Dependency injection framework for Galaxy-type apps."""
|
||||
|
||||
from typing import (
|
||||
Optional,
|
||||
Type,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
See the file error_codes.json for actual error code descriptions.
|
||||
"""
|
||||
|
||||
from json import loads
|
||||
from typing import Dict
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
FormDefinition and field factories
|
||||
"""
|
||||
|
||||
# TODO: A FormDefinitionField is closely linked to a form_builder result.
|
||||
# Can this functionality be further abstracted and merged with form_builder?
|
||||
from galaxy.model import (
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Actions to be run at job completion (or output hda creation, as in the case of
|
||||
immediate_actions listed below.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
from markupsafe import escape
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Utility classes allowing Job interface to reason about datasets.
|
||||
"""
|
||||
|
||||
import os.path
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
""" Code allowing tools to define extra files associated with an output datset.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import operator
|
||||
import os
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Utilities to help job and tool code setup jobs."""
|
||||
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
|
||||
@@ -10,6 +10,7 @@ Each :class:`JobInstrumenter` plugin object describes how to inject a bits
|
||||
of shell code into a job scripts (before and after tool commands run) and then
|
||||
collect the output of these from a job directory.
|
||||
"""
|
||||
|
||||
import collections
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Utilities related to formatting job metrics for human consumption."""
|
||||
|
||||
from typing import (
|
||||
Any,
|
||||
NamedTuple,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
These are responsible for collecting and formatting a coherent set of metrics.
|
||||
"""
|
||||
|
||||
import os.path
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``cgroup`` job metrics plugin."""
|
||||
|
||||
import decimal
|
||||
import logging
|
||||
import numbers
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``core`` job metrics plugin."""
|
||||
|
||||
import logging
|
||||
import time
|
||||
from typing import (
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``cpuinfo`` job metrics plugin."""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``env`` job metrics plugin."""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import (
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``hostname`` job metrics plugin."""
|
||||
|
||||
import logging
|
||||
|
||||
from . import InstrumentPlugin
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``meminfo`` job metrics plugin."""
|
||||
|
||||
import re
|
||||
|
||||
from galaxy import util
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""The module describes the ``uname`` job metrics plugin."""
|
||||
|
||||
from . import InstrumentPlugin
|
||||
from .. import formatting
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Support for running a tool in Galaxy via an internal job management system
|
||||
"""
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
import errno
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import time
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Top-level Galaxy job manager, moves jobs to handler(s)
|
||||
"""
|
||||
|
||||
import logging
|
||||
from functools import partial
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Base classes for job runner plugins.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import string
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
""" Galaxy job runners to use Amazon AWS native compute resources, such as AWS Batch.
|
||||
"""
|
||||
|
||||
import bisect
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
@@ -10,6 +10,7 @@ greater reuse of the DRM specific hooks you'll need to write. Ideally this plugi
|
||||
have been written to target that framework, but we don't have the bandwidth to rewrite
|
||||
it at this time.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Job runner plugin for executing jobs on the local system via the command line.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
More information on Pulsar can be found at https://pulsar.readthedocs.io/ .
|
||||
"""
|
||||
|
||||
import copy
|
||||
import errno
|
||||
import logging
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
SLURM job control via the DRMAA API.
|
||||
"""
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ known bugs/problems:
|
||||
cases 10.
|
||||
* The sheduler logs contains quite useful information.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
import signal
|
||||
|
||||
@@ -3,6 +3,7 @@ This module and its submodules contains utilities for running external
|
||||
processes and interfacing with job managers. This module should contain
|
||||
functionality shared between Galaxy and the Pulsar.
|
||||
"""
|
||||
|
||||
from galaxy.util.bunch import Bunch
|
||||
from .kill import kill_pid
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
from galaxy.util.plugin_config import plugins_dict
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Abstract base class for cli job plugins.
|
||||
"""
|
||||
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
abstractmethod,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Abstract base class for runners which execute commands via a shell.
|
||||
"""
|
||||
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
abstractmethod,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Condor helper utilities.
|
||||
"""
|
||||
|
||||
from subprocess import (
|
||||
CalledProcessError,
|
||||
check_call,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Interface layer for pykube library shared between Galaxy and Pulsar."""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
This is for use by web framework code and scripts (e.g. scripts/galaxy_main.py).
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import (
|
||||
List,
|
||||
|
||||
@@ -39,8 +39,7 @@ class AnnotatableManagerMixin:
|
||||
annotation_assoc: type
|
||||
|
||||
@abc.abstractmethod
|
||||
def session(self) -> scoped_session:
|
||||
...
|
||||
def session(self) -> scoped_session: ...
|
||||
|
||||
def annotation(self, item) -> Optional[str]:
|
||||
"""
|
||||
|
||||
@@ -21,6 +21,7 @@ and allow both predefined and user controlled key sets.
|
||||
ModelDeserializers control how a model validates and process an incoming
|
||||
attribute change to a model object.
|
||||
"""
|
||||
|
||||
# TODO: it may be there's a better way to combine the above three classes
|
||||
# such as: a single flat class, serializers being singletons in the manager, etc.
|
||||
# instead of the three separate classes. With no 'apparent' perfect scheme
|
||||
@@ -594,8 +595,7 @@ class SkipAttribute(Exception):
|
||||
|
||||
|
||||
class Serializer(Protocol):
|
||||
def __call__(self, item: Any, key: str, **context) -> Any:
|
||||
...
|
||||
def __call__(self, item: Any, key: str, **context) -> Any: ...
|
||||
|
||||
|
||||
# TODO: eventually all urls should be generated by the url builder and this can be safely removed.
|
||||
@@ -883,8 +883,7 @@ class ModelValidator:
|
||||
|
||||
|
||||
class Deserializer(Protocol):
|
||||
def __call__(self, item: Any, key: Any, val: Any, **kwargs) -> Any:
|
||||
...
|
||||
def __call__(self, item: Any, key: Any, val: Any, **kwargs) -> Any: ...
|
||||
|
||||
|
||||
class ModelDeserializer(HasAModelManager[T]):
|
||||
|
||||
@@ -61,9 +61,9 @@ class CloudAuthzsSerializer(base.ModelSerializer):
|
||||
"user_id": lambda item, key, **context: self.app.security.encode_id(item.user_id),
|
||||
"provider": lambda item, key, **context: str(item.provider),
|
||||
"config": lambda item, key, **context: item.config,
|
||||
"authn_id": lambda item, key, **context: self.app.security.encode_id(item.authn_id)
|
||||
if item.authn_id
|
||||
else None,
|
||||
"authn_id": lambda item, key, **context: (
|
||||
self.app.security.encode_id(item.authn_id) if item.authn_id else None
|
||||
),
|
||||
"last_update": lambda item, key, **context: str(item.last_update),
|
||||
"last_activity": lambda item, key, **context: str(item.last_activity),
|
||||
"create_time": lambda item, key, **context: item.create_time.isoformat(),
|
||||
|
||||
@@ -671,14 +671,12 @@ class DatasetCollectionManager:
|
||||
@overload
|
||||
def get_dataset_collection_instance(
|
||||
self, trans: ProvidesHistoryContext, instance_type: Literal["history"], id, **kwds: Any
|
||||
) -> model.HistoryDatasetCollectionAssociation:
|
||||
...
|
||||
) -> model.HistoryDatasetCollectionAssociation: ...
|
||||
|
||||
@overload
|
||||
def get_dataset_collection_instance(
|
||||
self, trans: ProvidesHistoryContext, instance_type: Literal["library"], id, **kwds: Any
|
||||
) -> model.LibraryDatasetCollectionAssociation:
|
||||
...
|
||||
) -> model.LibraryDatasetCollectionAssociation: ...
|
||||
|
||||
def get_dataset_collection_instance(
|
||||
self, trans: ProvidesHistoryContext, instance_type: DatasetCollectionInstanceType, id, **kwds: Any
|
||||
|
||||
@@ -4,6 +4,7 @@ and a more expanded set of data for admin in AdminConfigSerializer.
|
||||
|
||||
Used by both the API and bootstrapped data.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
from typing import (
|
||||
|
||||
@@ -28,6 +28,7 @@ should annotate their dependency on the narrowest context they require.
|
||||
A method that requires a user but not a history should declare its
|
||||
``trans`` argument as requiring type :class:`galaxy.managers.context.ProvidesUserContext`.
|
||||
"""
|
||||
|
||||
# TODO: Refactor this class so that galaxy.managers depends on a package
|
||||
# containing this.
|
||||
# TODO: Provide different classes for real users and potentially bootstrapped
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Manager and Serializer for Datasets.
|
||||
"""
|
||||
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Functionality for dealing with dbkeys.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os.path
|
||||
import re
|
||||
|
||||
@@ -8,6 +8,7 @@ models have some backing/supporting resources that can be removed as well
|
||||
the supporting resources as well. These models also have the boolean
|
||||
attribute 'purged'.
|
||||
"""
|
||||
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
@@ -32,8 +33,7 @@ class DeletableManagerMixin:
|
||||
removed by an admin/script.
|
||||
"""
|
||||
|
||||
def _session_setattr(self, item: Base, attr: str, val: Any, flush: bool = True):
|
||||
...
|
||||
def _session_setattr(self, item: Base, attr: str, val: Any, flush: bool = True): ...
|
||||
|
||||
def delete(self, item, flush=True, **kwargs):
|
||||
"""
|
||||
@@ -91,8 +91,7 @@ class PurgableManagerMixin(DeletableManagerMixin):
|
||||
file).
|
||||
"""
|
||||
|
||||
def _session_setattr(self, item: Base, attr: str, val: Any, flush: bool = True):
|
||||
...
|
||||
def _session_setattr(self, item: Base, attr: str, val: Any, flush: bool = True): ...
|
||||
|
||||
def purge(self, item, flush=True, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Utilities for loading tools and workflows from paths for admin user requests."""
|
||||
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Manager and Serializer for Library Folders.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import (
|
||||
|
||||
@@ -4,6 +4,7 @@ Manager and Serializer for HDAs.
|
||||
HistoryDatasetAssociations (HDAs) are datasets contained or created in a
|
||||
history.
|
||||
"""
|
||||
|
||||
import gettext
|
||||
import logging
|
||||
import os
|
||||
|
||||
@@ -4,6 +4,7 @@ Manager and Serializer for HDCAs.
|
||||
HistoryDatasetCollectionAssociations (HDCAs) are datasets contained or created in a
|
||||
history.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import Dict
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ Manager and Serializer for histories.
|
||||
Histories are containers for datasets or dataset collections
|
||||
created (or copied) by users over the course of an analysis.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import (
|
||||
Any,
|
||||
@@ -853,9 +854,9 @@ class HistorySerializer(sharable.SharableModelSerializer, deletable.PurgableSeri
|
||||
"contents_active": self.serialize_contents_active,
|
||||
# TODO: Use base manager's serialize_id for user_id (and others)
|
||||
# after refactoring hierarchy here?
|
||||
"user_id": lambda item, key, encode_id=True, **context: self.app.security.encode_id(item.user_id)
|
||||
if item.user_id is not None and encode_id
|
||||
else item.user_id,
|
||||
"user_id": lambda item, key, encode_id=True, **context: (
|
||||
self.app.security.encode_id(item.user_id) if item.user_id is not None and encode_id else item.user_id
|
||||
),
|
||||
}
|
||||
self.serializers.update(serializers)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Heterogenous lists/contents are difficult to query properly since unions are
|
||||
not easily made.
|
||||
"""
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Manager and Serializer for libraries.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import (
|
||||
Dict,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Manager and Serializer for library datasets."""
|
||||
|
||||
import logging
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
@@ -5,6 +5,7 @@ This file is meant to be relatively self contained and just used to "parse" and
|
||||
Galaxy Markdown. Keeping things isolated to allow re-use of these utilities in other
|
||||
projects (e.g. gxformat2).
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import (
|
||||
cast,
|
||||
|
||||
@@ -10,6 +10,7 @@ potential history flavor would allow objects to be referenced by HID. This
|
||||
second idea is unimplemented, it is just an example of the general concept of
|
||||
context specific processing.
|
||||
"""
|
||||
|
||||
import abc
|
||||
import base64
|
||||
import codecs
|
||||
|
||||
@@ -5,6 +5,7 @@ Pages are markup created and saved by users that can contain Galaxy objects
|
||||
(such as datasets) and are often used to describe or present an analysis
|
||||
from within Galaxy.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from html.entities import name2codepoint
|
||||
|
||||
@@ -3,6 +3,7 @@ Manager and Serializers for Quotas.
|
||||
|
||||
For more information about quotas: https://galaxyproject.org/admin/disk-quotas/
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import (
|
||||
cast,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user