Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def linkcode_resolve( # noqa: C901, PLR0911
}


def setup(app: sphinx.application.Sphinx) -> None: # ty: ignore[unresolved-attribute]
def setup(app: sphinx.application.Sphinx) -> None:
"""Configure sphinx."""
app.add_object_type(
"confval",
Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ force-single-line = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ty.rules]
unused-ignore-comment = "error"

[tool.ty.terminal]
error-on-warning = true

[[tool.ty.overrides]]
include = ["src/**/_version.py"]

[tool.ty.overrides.rules]
invalid-type-form = "ignore"

[[tool.ty.overrides]]
include = ["src/**/__init__.py"]

[tool.ty.overrides.rules]
unused-ignore-comment = "ignore"


[tool.pytest.ini_options]
addopts = ["--nbmake"]
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/pytask_parallel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pytask_parallel.backends import registry

try:
from ._version import version as __version__
from ._version import version as __version__ # ty: ignore[unresolved-import]
except ImportError:
# broken installation, we don't even try unknown only works because we do poor mans
# version compare
Expand Down
10 changes: 5 additions & 5 deletions src/pytask_parallel/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ def _update_carry_over_node(
return x
raise NotImplementedError

structure_carry_over_products = tree_structure(carry_over_products) # type: ignore[arg-type]
structure_produces = tree_structure(task.produces) # type: ignore[arg-type]
structure_carry_over_products = tree_structure(carry_over_products)
structure_produces = tree_structure(task.produces)
# strict must be false when none is leaf.
if structure_produces.is_prefix(structure_carry_over_products, strict=False):
task.produces = tree_map(
_update_carry_over_node,
task.produces, # type: ignore[arg-type]
carry_over_products, # type: ignore[arg-type]
) # type: ignore[assignment]
task.produces,
carry_over_products,
)


@define(kw_only=True)
Expand Down
2 changes: 1 addition & 1 deletion src/pytask_parallel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from coiled.function import Function as CoiledFunction
except ImportError:

class CoiledFunction: ... # type: ignore[no-redef]
class CoiledFunction: ...


__all__ = [
Expand Down
8 changes: 4 additions & 4 deletions src/pytask_parallel/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def wrap_task_in_thread(task: PTask, *, remote: bool, **kwargs: Any) -> WrapperR
exc_info = sys.exc_info()
else:
_handle_function_products(task, out, remote=remote)
exc_info = None # type: ignore[assignment]
exc_info = None
return WrapperResult(
carry_over_products=None, # type: ignore[arg-type]
warning_reports=[],
Expand Down Expand Up @@ -273,7 +273,7 @@ def _save_and_carry_over_product(
node.save(value)
return None

return tree_map_with_path(_save_and_carry_over_product, task.produces) # type: ignore[arg-type]
return tree_map_with_path(_save_and_carry_over_product, task.produces)


def _write_local_files_to_remote(
Expand All @@ -285,7 +285,7 @@ def _write_local_files_to_remote(
to be resolved.

"""
return tree_map(lambda x: x.load() if isinstance(x, RemotePathNode) else x, kwargs) # type: ignore[arg-type, return-value]
return tree_map(lambda x: x.load() if isinstance(x, RemotePathNode) else x, kwargs)


def _delete_local_files_on_remote(kwargs: dict[str, PyTree[Any]]) -> None:
Expand All @@ -302,4 +302,4 @@ def _delete(potential_node: Any) -> None:
os.close(potential_node.fd)
Path(potential_node.remote_path).unlink(missing_ok=True)

tree_map(_delete, kwargs) # type: ignore[arg-type]
tree_map(_delete, kwargs)