obriencj / koji-typing

Experimental typing support for Koji
GNU General Public License v3.0
0 stars 0 forks source link

wishlist: client session decorated with additional api calls for various plugins #4

Open obriencj opened 4 months ago

obriencj commented 4 months ago

wishlist item, some way to type a ClientSession and indicate which hub plugins you're expecting to be able to make calls against.

eg.

# normal client session, with default API calls available
session: ClientSession = ClientSession(...)

# client session, with default API calls plus also the Atomic Reactor API calls
session: ClientSessionExt[OSBS] = ClientSession(...)

# client session with multiple plugins
session: ClientSessionExt[OSBS, MBS] = ClientSession(...)

I'm not at all sure how to make that work, or if it's even remotely possible.

obriencj commented 4 months ago

I might be able to create a mypy hook for this, and add the feature to preoccupied.proxytype