Skip to content

Commit

Permalink
Enable warn_unused_ignores mypy option
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Apr 15, 2024
1 parent dcd8f1c commit d051dd8
Show file tree
Hide file tree
Showing 68 changed files with 177 additions and 187 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from pkgutil import extend_path

__path__ = extend_path(__path__, __name__) # type: ignore[has-type]
__path__ = extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion lib/galaxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def __init__(self, **kwargs) -> None:
self.watchers = self._register_singleton(ConfigWatchers)
self._configure_toolbox()
# Load Data Manager
self.data_managers = self._register_singleton(DataManagers) # type: ignore[type-abstract]
self.data_managers = self._register_singleton(DataManagers)
# Load the update repository manager.
self.update_repository_manager = self._register_singleton(
UpdateRepositoryManager, UpdateRepositoryManager(self)
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/app_unittest_utils/toolbox_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def setUp(self):
install_model = mapping.init("sqlite:///:memory:", create_tables=True)
self.app.tool_cache = ToolCache()
self.app.install_model = install_model
self.app.reindex_tool_search = self.__reindex # type: ignore[assignment]
self.app.reindex_tool_search = self.__reindex # type: ignore[method-assign]
itp_config = os.path.join(self.test_directory, "integrated_tool_panel.xml")
self.app.config.integrated_tool_panel_config = itp_config
self.app.watchers = ConfigWatchers(self.app)
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/authnz/custos_authnz.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
try:
import pkce
except ImportError:
pkce = None # type: ignore[assignment]
pkce = None # type: ignore[assignment, unused-ignore]

log = logging.getLogger(__name__)
STATE_COOKIE_NAME = "galaxy-oidc-state"
Expand Down
8 changes: 4 additions & 4 deletions lib/galaxy/datatypes/constructive_solid_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def display_peek(self, dataset: DatasetProtocol) -> str:
return f"Ply file ({nice_size(dataset.get_size())})"


class PlyAscii(Ply, data.Text): # type: ignore[misc]
class PlyAscii(Ply, data.Text):
"""
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname('test.plyascii')
Expand All @@ -160,7 +160,7 @@ def __init__(self, **kwd):
data.Text.__init__(self, **kwd)


class PlyBinary(Ply, Binary): # type: ignore[misc]
class PlyBinary(Ply, Binary):
file_ext = "plybinary"
subtype = "binary"

Expand Down Expand Up @@ -477,7 +477,7 @@ def display_peek(self, dataset: DatasetProtocol) -> str:
return f"Vtk file ({nice_size(dataset.get_size())})"


class VtkAscii(Vtk, data.Text): # type: ignore[misc]
class VtkAscii(Vtk, data.Text):
"""
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname('test.vtkascii')
Expand All @@ -495,7 +495,7 @@ def __init__(self, **kwd):
data.Text.__init__(self, **kwd)


class VtkBinary(Vtk, Binary): # type: ignore[misc]
class VtkBinary(Vtk, Binary):
"""
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname('test.vtkbinary')
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/jobs/runners/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,10 @@ def parse_destination_params(self, params):
check_required = []
parsed_params = {}
for k, spec in self.DESTINATION_PARAMS_SPEC.items():
value = params.get(k, spec.get("default")) # type: ignore[attr-defined]
if spec.get("required") and not value: # type: ignore[attr-defined]
value = params.get(k, spec.get("default"))
if spec.get("required") and not value:
check_required.append(k)
mapper = spec.get("map") # type: ignore[attr-defined]
mapper = spec.get("map")
parsed_params[k] = mapper(value) # type: ignore[operator]
if check_required:
raise AWSBatchRunnerException(
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/jobs/runners/util/kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
except ImportError:
"""Don't make psutil a strict requirement, but use if available."""
Process = None # type: ignore
Process = None


def kill_pid(pid: int, use_psutil: bool = True):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _contained_id_map(self, id_list):
component_class = self.contained_class
stmt = (
select(component_class)
.where(component_class.id.in_(id_list)) # type: ignore[attr-defined]
.where(component_class.id.in_(id_list))
.options(undefer(component_class._metadata))
.options(joinedload(component_class.dataset).joinedload(model.Dataset.actions))
.options(joinedload(component_class.tags)) # type: ignore[attr-defined]
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def by_api_key(self, api_key: str, sa_session=None):

def by_oidc_access_token(self, access_token: str):
if hasattr(self.app, "authnz_manager") and self.app.authnz_manager:
user = self.app.authnz_manager.match_access_token_to_user(self.app.model.session, access_token) # type: ignore[attr-defined]
user = self.app.authnz_manager.match_access_token_to_user(self.app.model.session, access_token)
return user
else:
return None
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def build_invocations_query(
for inv in trans.sa_session.scalars(stmt)
if self.check_security(trans, inv, check_ownership=True, check_accessible=False)
]
return invocations, total_matches # type:ignore[return-value]
return invocations, total_matches


MissingToolsT = List[Tuple[str, str, Optional[str], str]]
Expand Down
Loading

0 comments on commit d051dd8

Please sign in to comment.