From 0d2d02f84019a4bfbe46d5fa8b7a4b4178352674 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:09:50 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.9 → v0.5.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.9...v0.5.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From d2e98dd25cefe3ef3d2b6a31478c64a2d723dee3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:10:41 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytask/collect.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/_pytask/collect.py b/src/_pytask/collect.py index 994279273..90fa9cef3 100644 --- a/src/_pytask/collect.py +++ b/src/_pytask/collect.py @@ -247,11 +247,7 @@ 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 From f022a6b7a4656c76c011e7a166b74fe863bbc0e5 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Fri, 12 Jul 2024 22:23:01 +0200 Subject: [PATCH 3/3] Fix. --- docs_src/how_to_guides/provisional_products.py | 2 +- src/_pytask/collect.py | 5 ++++- src/_pytask/task_utils.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) 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 90fa9cef3..05e237cbb 100644 --- a/src/_pytask/collect.py +++ b/src/_pytask/collect.py @@ -247,7 +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" - return bool(hasattr(obj, attr_name) and not bool(inspect.getattr_static(obj, attr_name, 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)