2025-03-25 16:02:03 +00:00
|
|
|
import subprocess
|
2014-02-03 17:14:46 +00:00
|
|
|
|
2025-03-25 16:02:03 +00:00
|
|
|
from setuptools import setup
|
|
|
|
from setuptools.command.sdist import sdist as base_sdist
|
2014-07-01 13:35:10 +00:00
|
|
|
|
2014-02-03 17:14:46 +00:00
|
|
|
|
2025-03-25 16:02:03 +00:00
|
|
|
class sdist(base_sdist):
|
|
|
|
def compile_assets(self):
|
|
|
|
try:
|
|
|
|
subprocess.check_call(["npm", "run", "build"])
|
|
|
|
except (OSError, subprocess.CalledProcessError) as e:
|
|
|
|
print("Error compiling assets: " + str(e)) # noqa: T201
|
|
|
|
raise SystemExit(1)
|
2014-02-07 18:12:06 +00:00
|
|
|
|
2025-03-25 16:02:03 +00:00
|
|
|
def run(self):
|
|
|
|
self.compile_assets()
|
|
|
|
base_sdist.run(self)
|
2014-02-07 18:12:06 +00:00
|
|
|
|
|
|
|
|
2014-02-03 17:14:46 +00:00
|
|
|
setup(
|
2022-02-14 13:25:00 +00:00
|
|
|
name="wagtail",
|
2025-03-26 07:21:32 +00:00
|
|
|
cmdclass={"sdist": sdist},
|
2014-02-07 15:39:59 +00:00
|
|
|
)
|