fix: Clean up imports and formatting in hatch_build.py and markdown_view_plugin.py
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
# hatch_build.py
|
||||
import subprocess
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
||||
|
||||
|
||||
class MarkdownBuildHook(BuildHookInterface):
|
||||
def initialize(self, version, build_data):
|
||||
# 1. Compile the UI exactly once per build
|
||||
@@ -15,9 +17,7 @@ class MarkdownBuildHook(BuildHookInterface):
|
||||
shutil.rmtree(dist_dir)
|
||||
|
||||
# Install dependencies and build the UI
|
||||
subprocess.run([
|
||||
"pnpm", "install", "--frozen-lockfile"
|
||||
], cwd=ui_dir, check=True)
|
||||
subprocess.run(["pnpm", "install", "--frozen-lockfile"], cwd=ui_dir, check=True)
|
||||
subprocess.run(["pnpm", "run", "build"], cwd=ui_dir, check=True)
|
||||
|
||||
# 2. Force-include the compiled assets in the wheel
|
||||
|
||||
Reference in New Issue
Block a user