Skip to content

Commit ff77a47

Browse files
authored
Fix info under live execution table. (#267)
1 parent 58d8969 commit ff77a47

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/source/changes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask).
77

8-
## 0.2.1 - 2022-xx-xx
8+
## 0.2.2 - 2022-xx-xx
9+
10+
- {pull}`267` fixes the info under the live execution table to show the total number of
11+
tasks also for pytask-parallel.
12+
13+
## 0.2.1 - 2022-04-28
914

1015
- {pull}`259` adds an `.svg` for profiling tasks.
1116
- {pull}`261` adds a config file option to sort entries in live table

docs/source/developers_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To profile pytask, you can follow this
4141
`git bisect`, caching, and profiling tools). We use {mod}`cProfile` with
4242

4343
```console
44-
$ python -m cProfile -o log.pstats pytask directory/with/tasks
44+
$ python -m cProfile -o log.pstats -m pytask directory/with/tasks
4545
```
4646

4747
The profile can be visualized with

src/_pytask/live.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
9393
config["pm"].register(live_collection, "live_collection")
9494

9595

96-
@hookimpl(tryfirst=True)
97-
def pytask_execute_build(session: Session) -> None:
96+
@hookimpl(hookwrapper=True)
97+
def pytask_execute(session: Session) -> Generator[None, None, None]:
9898
if session.config["verbose"] >= 1:
9999
live_execution = session.config["pm"].get_plugin("live_execution")
100-
live_execution.n_tasks = len(session.tasks)
100+
if live_execution:
101+
live_execution.n_tasks = len(session.tasks)
102+
103+
yield
101104

102105

103106
@attr.s(eq=False)

0 commit comments

Comments
 (0)