Skip to content

Commit

Permalink
Update to black 2024 stable style
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jan 30, 2024
1 parent 24b90be commit 93a2fcb
Show file tree
Hide file tree
Showing 393 changed files with 553 additions and 336 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions lib/galaxy/actions/library.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains library functions
"""

import json
import logging
import os.path
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/app_unittest_utils/galaxy_mock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Mock infrastructure for testing ModelManagers.
"""

import os
import shutil
import tempfile
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains implementations of the authentication logic.
"""

import logging

from galaxy.auth.util import (
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/auth/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@author: Andrew Robinson
"""

import abc


Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/auth/providers/alwaysreject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@author: Andrew Robinson
"""

import logging

from . import AuthProvider
Expand Down
1 change: 0 additions & 1 deletion lib/galaxy/auth/providers/ldap_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def _parse_ldap_options(options_unparsed):


class LDAP(AuthProvider):

"""
Attempts to authenticate users against an LDAP server.
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/auth/providers/localdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@author: Andrew Robinson
"""

import logging

from . import AuthProvider
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/auth/providers/pam_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Author Peter van Heusden ([email protected])
"""

import logging
import shlex

Expand Down
7 changes: 4 additions & 3 deletions lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Universe configuration builder.
"""

# absolute_import needed for tool_shed package.

import configparser
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/anvio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Datatypes for Anvi'o
https://github.com/merenlab/anvio
"""

import glob
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
External datatypes may make use of these functions.
"""

from galaxy.util.checkers import (
check_binary,
check_bz2,
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/constructive_solid_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/converters/interval_to_fli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
and symbols are sorted in lexigraphical order.
"""

import optparse

from bx.tabular.io import (
Expand Down
12 changes: 6 additions & 6 deletions lib/galaxy/datatypes/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ def _serve_raw(
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,
Expand Down Expand Up @@ -476,9 +476,9 @@ def _serve_file_download(self, headers, data, trans, to_ext, file_size, **kwd):
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

Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/base.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Primarily for file sources but usable by any iterator that has both
seek and read( N ).
"""

import base64
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- or provide data in some way relevant to bioinformatic data
(e.g. parsing genomic regions from their source)
"""

import logging
import sys

Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/hierarchy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Dataproviders that iterate over lines from their sources.
"""

import logging

from galaxy.util import (
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/dataproviders/line.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Dataproviders that iterate over lines from their sources.
"""

import collections
import logging
import re
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/genetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ross lazarus for rgenetics
august 20 2007
"""

import logging
import os
import re
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/gis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
GIS classes
"""

from galaxy.datatypes.binary import Binary
from galaxy.datatypes.protocols import (
DatasetProtocol,
Expand Down
2 changes: 0 additions & 2 deletions lib/galaxy/datatypes/goldenpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def _validate_line(self):


class AGPSeqLine(AGPLine):

"""
A subclass of AGPLine specifically for AGP lines that represent sequences.
"""
Expand Down Expand Up @@ -462,7 +461,6 @@ def _validate_line(self):


class AGPGapLine(AGPLine):

"""
A subclass of AGPLine specifically for AGP lines that represent sequence gaps.
"""
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Graph content classes.
"""

import logging
from typing import List

Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/images.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Image classes
"""

import base64
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/interval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Interval datatypes
"""

import logging
import sys
import tempfile
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/media.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Video classes"""

import json
import subprocess
import wave
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/mothur.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Mothur Metagenomics Datatypes
"""

import logging
import re
from typing import (
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/neo4j.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Neo4j Composite Dataset
"""

import logging

from galaxy.datatypes.data import Data
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/ngsindex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
NGS indexes
"""

import logging
import os

Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/phylip.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@githuborganization: C3BI
Phylip datatype sniffer
"""

from typing import TYPE_CHECKING

from galaxy import util
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/datatypes/proteomics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Proteomics Datatypes
"""

import logging
import re
from typing import (
Expand Down
Loading

0 comments on commit 93a2fcb

Please sign in to comment.