BUG: using `pytask.task()(func_defined_in_other_file)` doesn't work
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
- 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.
- Langage dominant
- Python
- Étoiles
- 146
- Forks
- 14
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 34
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pytask-dev/pytask
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 45/100
pytask-dev/pytask#985 ·
-
ENH: a few design ideas Ouverteenhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
pytask-dev/pytask#786 · 2 commentaires ·
-
ENH: add some more common Nodes Ouverteenhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
pytask-dev/pytask#503 · 1 commentaire · 1 réaction ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
pytask-dev/pytask#403 ·
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
pytask-dev/pytask#320 · 1 commentaire ·
Toutes les issues de pytask-dev/pytask
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
stephrobert/dsoxlab#238 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
sublimehq/package_control#1780 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
nwg-piotr/nwg-displays#145 ·