BUG: using `pytask.task()(func_defined_in_other_file)` doesn't work
まだ誰も着手していません。
評価
調査の方向性
Start with the pytask.task() decorator and trace how the function from lib.py is registered when called in task_bug.py. Inspect the COLLECTED_TASKS lookup path and the tasks.zip reproduction; done means the task is discovered under task_bug.py and executes with the expected output.
索引モデルが issue の本文から書いたものです。
説明
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of pytask.
- (optional) I have confirmed this bug exists on the
mainbranch of pytask.
Code Sample, a copy-pastable example
zipped dir: tasks.zip
# lib.py
def get_name():
return "jane"
# task_bug.py
from pathlib import Path
import pytask
from .lib import get_name
task_get_name = pytask.task(produces=Path("name.txt"))(get_name)
Problem description
It appears that inpytask.task(), the created task is stored in COLLECTED_TASKS,
but is stored under COLLECTED_TASKS["lib.py"] (the place where the function was defined), not under COLLECTED_TASKS["task_bug.py"] (where the task was created). Then, when we actually go looking through COLLECTED_TASKS for tasks to execute, we miss it because we only look under "task_bug.py"
Expected Output
I think the created task should be stored under COLLECTED_TASKS["task_bug.py"] where the task was created.
- 主要言語
- Python
- スター
- 146
- フォーク
- 14
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 34
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytask-dev/pytask のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
pytask-dev/pytask#985 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
pytask-dev/pytask#786 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
pytask-dev/pytask#503 · コメント 1 件 · リアクション 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
pytask-dev/pytask#403 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytask-dev/pytask#320 · コメント 1 件 ·
pytask-dev/pytask の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·