Closed DetachHead closed 5 months ago
# but there doesn't seem to be a nice way to register these hooks when defining them this way, # so i have to add this: pdm_build_update_files = Hook().pdm_build_update_files
There is:
hooks = Hooks()
def __getattr__(attr):
return getattr(hooks, attr)
def __dir__():
return dir(hooks)
Is your feature/enhancement proposal related to a problem? Please describe.
in my
pdm_build.py
, i want to extendBuildHookInterface
so that my type checker ensures that my hook methods have the correct function signatures:Describe the solution you'd like
a way to register the hooks from the class. maybe something like this, which can be added to the bottom of
pdm_build.py
:or it could be a class decorator: