From 929b7c9a5c88ff35f9ac1584e3c63e5094dc3d3f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 10 Jun 2020 12:31:23 +0200 Subject: [PATCH] Still trying to get CSS generation to happen within install... --- setup.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3190d5e916..332afaddd8 100755 --- a/setup.py +++ b/setup.py @@ -3,12 +3,14 @@ import errno import os import re -import distutils.cmd +from distutils.cmd import Command +from distutils.command.build import build as _build from distutils.command.install import install from setuptools import setup, find_packages +from setuptools.command.bdist_egg import bdist_egg as _bdist_egg -class WebBuildCommand(distutils.cmd.Command): +class WebBuildCommand(Command): """ Custom command to build the web files """ @@ -66,6 +68,16 @@ class InstallCommand(install): install.do_egg_install(self) +class bdist_egg(_bdist_egg): + def run(self): + self.run_command('web_build') + _bdist_egg.run(self) + + +class build(_build): + sub_commands = _build.sub_commands + [('web_build', None)] + + def path(fname=''): return os.path.abspath(os.path.join(os.path.dirname(__file__), fname)) @@ -126,6 +138,8 @@ setup( cmdclass={ 'web_build': WebBuildCommand, 'install': InstallCommand, + 'build': build, + 'bdist_egg': bdist_egg, }, # data_files = [ # ('/etc/platypush', ['platypush/config.example.yaml'])