Skip to content

Rename task cancel to request_stop - #514

Merged
payno merged 9 commits into
mainfrom
rename_task_cancel_to_abort
Oct 13, 2026
Merged

payno merged 9 commits into
mainfrom
rename_task_cancel_to_abort

Conversation

@payno

@payno payno commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

PR summary

This PR deprecate Task cancel function to the benefit of request_stop which is semantically more correct.

AI Disclosure

  • Claude used (Opus 5.5)

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ewokscore/task.py 71.42% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@payno payno changed the title Draft: Rename task cancel to abort Rename task cancel to abort Oct 7, 2026
@payno
payno requested a review from a team October 7, 2026 07:43
Comment thread src/ewokscore/tests/test_task.py Outdated
Comment thread src/ewokscore/task.py Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
@woutdenolf

woutdenolf commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Notw that with the Ewoks task does is a "cooperative abort" which I would call neither cancel nor abort. I vote for the word stop.

In terms of API I propose: Task.request_stop() and Task.stop_requested.

@payno payno changed the title Rename task cancel to abort Rename task cancel to request_stop Oct 8, 2026
@payno

payno commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Indeed request_stop and stop_requested are better names. Applied in 835a289

payno and others added 7 commits October 8, 2026 08:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Loïc Huder <42204205+loichuder@users.noreply.github.com>
Co-authored-by: Loïc Huder <42204205+loichuder@users.noreply.github.com>
Co-authored-by: Loïc Huder <42204205+loichuder@users.noreply.github.com>
…Task.cancelled' to 'Task.stop_requested'.

Note: Task._cancelled renamed Task._stop_requested without deprecation (protected)
@payno
payno force-pushed the rename_task_cancel_to_abort branch from 2333a4b to d618db3 Compare October 8, 2026 06:34
@woutdenolf

woutdenolf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Note that I made an assumption when proposing the names because I do not know what the original cancelled means.

There are two possibilities for the boolean: either the stop is requested or it stopped. I assumed the first meaning although the word "cancelled" seems to suggest the second.

Comment thread src/ewokscore/task.py Outdated
…ted`.

Users that wants to implement a specific behavior when stopping are expected to implement `on_stop_requested`.
Comment thread src/ewokscore/task.py
@payno
payno requested a review from woutdenolf October 12, 2026 07:03
@payno
payno force-pushed the rename_task_cancel_to_abort branch from 0900d3f to e447aa6 Compare October 13, 2026 07:40

@woutdenolf woutdenolf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Much clearer!

Comment thread pyproject.toml
[project]
name = "ewokscore"
version = "5.1.0rc4"
version = "5.1.0rc5"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do the rc to get CI aligned with ewoksorange

@payno
payno merged commit 9a41ae2 into main Oct 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants