Chore: Add npm build hooks (#649)

This commit is contained in:
Jim Brännlund 2023-04-14 15:01:48 +02:00 committed by GitHub
parent bab8e541b0
commit 8287c84588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -91,3 +91,6 @@ exclude = [
[tool.hatch.build.hooks.vcs]
version-file = "src/pytest_html/__version.py"
[tool.hatch.build.hooks.custom]
path = "scripts/npm.py"

9
scripts/npm.py Normal file
View File

@ -0,0 +1,9 @@
import subprocess
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
class NpmBuildHook(BuildHookInterface):
def initialize(self, version, build_data):
subprocess.check_output("npm install", shell=True)
subprocess.check_output("npm run build", shell=True)