Skip to content

Add ability to register hook from code#236

Merged
vstinner merged 5 commits into
psf:mainfrom
sergey-miryanov:feat/register-hooks
Mar 21, 2026
Merged

Add ability to register hook from code#236
vstinner merged 5 commits into
psf:mainfrom
sergey-miryanov:feat/register-hooks

Conversation

@sergey-miryanov

Copy link
Copy Markdown
Contributor

Closes #235

@sergey-miryanov

Copy link
Copy Markdown
Contributor Author

@vstinner Could you please take a look?

Comment thread pyperf/tests/test_runner.py Outdated
Comment thread pyperf/_hooks.py Outdated
Comment thread pyperf/_hooks.py Outdated
Comment thread pyperf/_runner.py Outdated
Comment thread pyperf/tests/test_runner.py Outdated
Comment thread doc/api.rst Outdated
(``list``) which must be modified in place and *args* is the :attr:`args`
attribute of the runner.

*hooks* is a list of custom hooks. Each hook should implement ``HookBase`` and

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.

Would it be possible to document HookBase so you can refer to it in the doc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, will do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added, but I not very good in writing a documentation.

It is ready to review. Could you please take a look?

Comment thread doc/api.rst Outdated
sergey-miryanov and others added 2 commits March 20, 2026 16:33
Co-authored-by: Victor Stinner <vstinner@python.org>
Comment thread doc/api.rst Outdated
Comment thread doc/api.rst Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>

@vstinner vstinner 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.

LGTM

@vstinner vstinner merged commit 7084a7c into psf:main Mar 21, 2026
12 checks passed
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks for your contribution.

@sergey-miryanov

Copy link
Copy Markdown
Contributor Author

Thanks!

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.

Add ability to register hook from code

2 participants