Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

planning towards supporting fully mixed sync/async hook calling

Open
#378 6 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

No files, tests, or entry points are named. Start by reviewing the proposed async hook caller and the described sync/async nesting and thread-executor cases. Done would require an agreed design and implementation that supports the outlined mixed hook-calling behavior.

Written by the indexing model from the issue text.

Description

cc @simonw

this is a rough outline of supporting async hook calls and awaitable results in

the starting point will be a async hook caller that will call sync and async hook, deferring all awaitables to the event loop

nesting like async->sync->async will trigger failures when awaitables are encountered in the inner loop

the next level will be deferring all sync calls to a thread executor
any sync call that triggers a awaitable, will steal one thread of that pool , this is considered acceptable as execution is typically expected to be fairly non-concurrent (based on pytest)

a own threadpool with a maxium size of 10 ? shal be used (this accounts for the expectation that hooks run in order and should not nest to arbitrary levels)

nonblocking sync hooks may be marked as nonblocking
in which case they may run in the mainloop, as before nesting async into sync will trigger errros

the primary use case for nonblocking sync hooks is to support being nested into other legacy hooks without causing issues but transparently working with modern hook calls

Dominant language
Python
Stars
1.7k
Forks
170
Avg merge
1d 23h
Merged PRs (30d)
16

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pytest-dev/pluggy

All issues in pytest-dev/pluggy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.