| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import logging |
| 4 |
from pathlib import Path |
| 5 |
from typing import Any |
| 6 |
|
| 7 |
from pdm.backend.hooks.base import Context |
| 8 |
|
| 9 |
logger = logging.getLogger("hooks") |
| 10 |
|
| 11 |
|
| 12 |
class BuildHook: |
| 13 |
def __init__(self, name: str = "2") -> None: |
| 14 |
self.name = name |
| 15 |
|
| 16 |
def pdm_build_clean(self, context: Context) -> None: |
| 17 |
logger.info("Hook%s build clean called", self.name) |
| 18 |
|
| 19 |
def pdm_build_initialize(self, context: Context) -> None: |
| 20 |
logger.info("Hook%s build initialize called", self.name) |
| 21 |
|
| 22 |
def pdm_build_update_files(self, context: Context, files: dict[str, Path]) -> None: |
| 23 |
logger.info("Hook%s build update files called", self.name) |
| 24 |
|
| 25 |
def pdm_build_finalize(self, context: Context, artifact: Path) -> None: |
| 26 |
logger.info("Hook%s build finalize called", self.name) |
| 27 |
|
| 28 |
|
| 29 |
# Hook instance |
| 30 |
hook3 = BuildHook("3") |