Initialize the build hook. Args: version: The version being built. build_data: Additional build data.
(self, version: str, build_data: dict[str, Any])
| 25 | ) |
| 26 | |
| 27 | def initialize(self, version: str, build_data: dict[str, Any]) -> None: |
| 28 | """Initialize the build hook. |
| 29 | |
| 30 | Args: |
| 31 | version: The version being built. |
| 32 | build_data: Additional build data. |
| 33 | """ |
| 34 | if self.marker().exists(): |
| 35 | return |
| 36 | |
| 37 | if not (pathlib.Path(self.root) / "scripts").exists(): |
| 38 | return |
| 39 | |
| 40 | for file in (pathlib.Path(self.root) / "reflex").rglob("**/*.pyi"): |
| 41 | file.unlink(missing_ok=True) |
| 42 | |
| 43 | subprocess.run( |
| 44 | [sys.executable, "-m", "reflex_base.utils.pyi_generator"], |
| 45 | check=True, |
| 46 | ) |
| 47 | self.marker().touch() |