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: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ repos:
attrs,
cloudpickle,
loky,
pytask>=0.4.5,
"git+https://github.com/pytask-dev/pytask.git@main",
rich,
types-click,
types-setuptools,
Expand Down
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
[Anaconda.org](https://anaconda.org/conda-forge/pytask-parallel).

## 0.4.2 - 2024-xx-xx
## 0.5.0 - 2024-xx-xx

- {pull}`85` simplifies code since loky is a dependency.
- {pull}`88` updates handling `Traceback`.
- {pull}`89` restructures the package.

## 0.4.1 - 2024-01-12
Expand Down
6 changes: 2 additions & 4 deletions src/pytask_parallel/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
from pytask import PTask
from pytask import PythonNode
from pytask import Session
from pytask import Traceback
from pytask import WarningReport
from pytask import console
from pytask import get_marks
from pytask import hookimpl
from pytask import parse_warning_filter
from pytask import remove_internal_traceback_frames_from_exc_info
from pytask import warning_record_to_str
from pytask.tree_util import PyTree
from pytask.tree_util import tree_map
from rich.traceback import Traceback

from pytask_parallel.utils import create_kwargs_for_task
from pytask_parallel.utils import handle_task_function_return
Expand Down Expand Up @@ -161,8 +160,7 @@ def _process_exception(
console_options: ConsoleOptions,
) -> tuple[type[BaseException], BaseException, str]:
"""Process the exception and convert the traceback to a string."""
exc_info = remove_internal_traceback_frames_from_exc_info(exc_info)
traceback = Traceback.from_exception(*exc_info, show_locals=show_locals)
traceback = Traceback(exc_info, show_locals=show_locals)
segments = console.render(traceback, options=console_options)
text = "".join(segment.text for segment in segments)
return (*exc_info[:2], text)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ def test_collect_warnings_from_parallelized_tasks(runner, tmp_path, parallel_bac
source = """
from pytask import task
import warnings
from pathlib import Path

for i in range(2):

@task(id=str(i), kwargs={"produces": f"{i}.txt"})
@task(id=str(i), kwargs={"produces": Path(f"{i}.txt")})
def task_example(produces):
warnings.warn("This is a warning.")
produces.touch()
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ package = editable

[testenv:test]
extras = test
deps =
git+https://github.com/pytask-dev/pytask.git@main
commands =
pytest --nbmake {posargs}