Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#622)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tobias Raabe <raabe@posteo.de>
  • Loading branch information
pre-commit-ci[bot] and tobiasraabe authored Jul 12, 2024
1 parent 0f2b34a commit 396030c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
hooks:
- id: sort-all
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.5.1
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion docs_src/how_to_guides/provisional_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def get_files_without_file_extensions_from_repo() -> list[str]:
url = "https://api.github.com/repos/pytask-dev/pytask/git/trees/main"
response = httpx.get(url)
response = httpx.get(url, timeout=10)
elements = response.json()["tree"]
return [
e["path"]
Expand Down
9 changes: 4 additions & 5 deletions src/_pytask/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ def _is_filtered_object(obj: Any) -> bool:
# Filter objects overwriting the ``__getattr__`` method like :class:`pytask.mark` or
# ``from ibis import _``.
attr_name = "attr_that_definitely_does_not_exist"
if hasattr(obj, attr_name) and not bool(
inspect.getattr_static(obj, attr_name, False)
):
return True
return False
return bool(
hasattr(obj, attr_name)
and not bool(inspect.getattr_static(obj, attr_name, False))
)


@hookimpl
Expand Down
3 changes: 1 addition & 2 deletions src/_pytask/task_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ def parse_collected_tasks_with_task_marker(
if name in duplicated_names:
selected_tasks = [i for i in parsed_tasks if i[0] == name]
names_to_functions = _generate_ids_for_tasks(selected_tasks)
for unique_name, task in names_to_functions.items():
collected_tasks[unique_name] = task
collected_tasks.update(names_to_functions)
else:
collected_tasks[name] = next(i[1] for i in parsed_tasks if i[0] == name)

Expand Down

0 comments on commit 396030c

Please sign in to comment.