Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
- {pull}`289` shortens the task ids when using `pytask collect`. Fixes {issue}`286`.
- {pull}`290` implements a dry-run with `pytask --dry-run` to see which tasks would be
executed.
- {pull}`296` fixes a bug where the source code of wrapped function could not be
retrieved.

## 0.2.4 - 2022-06-28

Expand Down
2 changes: 2 additions & 0 deletions src/_pytask/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ def _get_source_lines(function: Callable[..., Any]) -> int:
"""Get the source line number of the function."""
if isinstance(function, functools.partial):
return _get_source_lines(function.func)
elif hasattr(function, "__wrapped__"):
return _get_source_lines(function.__wrapped__) # type: ignore[attr-defined]
else:
return inspect.getsourcelines(function)[1]

Expand Down