ci: fix scss build on building
We add a custom hook to our sdist target, such that "make scss" is run whenever we run `python -m build --sdist`.
This commit is contained in:
parent
269e06e935
commit
46f7d7af30
@ -3,11 +3,6 @@ variables:
|
||||
TUTOR_PYPI_PACKAGE: tutor-deck
|
||||
GITHUB_REPO: overhangio/tutor-deck
|
||||
|
||||
build-css:
|
||||
script:
|
||||
- make scss
|
||||
stage: build
|
||||
|
||||
include:
|
||||
- project: "community/tutor-ci"
|
||||
file: "plugin-gitlab-ci.yml"
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
# https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/
|
||||
import os
|
||||
import subprocess
|
||||
import typing as t
|
||||
|
||||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
||||
from hatchling.metadata.plugin.interface import MetadataHookInterface
|
||||
|
||||
HERE = os.path.dirname(__file__)
|
||||
|
||||
|
||||
class CustomBuildHook(BuildHookInterface):
|
||||
def initialize(self, version, build_data):
|
||||
# This runs before the build starts
|
||||
subprocess.check_call(["make", "scss"])
|
||||
|
||||
|
||||
class MetaDataHook(MetadataHookInterface):
|
||||
def update(self, metadata: dict[str, t.Any]) -> None:
|
||||
about = load_about()
|
||||
|
||||
@ -69,5 +69,9 @@ strict-naming = false
|
||||
include = [ "/tutordeck", ".hatch_build.py"]
|
||||
exclude = ["tests*"]
|
||||
|
||||
[tool.hatch.build.targets.sdist.hooks.custom]
|
||||
# Build static assets prior to running sdist
|
||||
path = ".hatch_build.py"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["tutordeck"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user