diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 331ec8b04..e8aa8d395 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/docs_src/how_to_guides/provisional_products.py b/docs_src/how_to_guides/provisional_products.py index 269c327a0..6293dff4b 100644 --- a/docs_src/how_to_guides/provisional_products.py +++ b/docs_src/how_to_guides/provisional_products.py @@ -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"] diff --git a/src/_pytask/collect.py b/src/_pytask/collect.py index 994279273..05e237cbb 100644 --- a/src/_pytask/collect.py +++ b/src/_pytask/collect.py @@ -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 diff --git a/src/_pytask/task_utils.py b/src/_pytask/task_utils.py index 7ee001782..045a1eed3 100644 --- a/src/_pytask/task_utils.py +++ b/src/_pytask/task_utils.py @@ -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)