-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dirac_webapp_packaging and DIRACWebAppResources
- Loading branch information
Showing
3 changed files
with
6 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,5 @@ | ||
import os | ||
import subprocess | ||
from dirac_webapp_packaging import extjs_cmdclass | ||
from setuptools import setup | ||
|
||
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly | ||
# update it when the contents of directories change. | ||
if os.path.exists('MANIFEST'): os.remove('MANIFEST') | ||
|
||
from setuptools import Command, setup | ||
# Note: distutils must be imported after setuptools | ||
from distutils import log | ||
from setuptools.command.develop import develop as _develop | ||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel | ||
|
||
|
||
class build_extjs_sources(Command): | ||
user_options = [] | ||
|
||
def initialize_options(self): | ||
pass | ||
|
||
def finalize_options(self): | ||
pass | ||
|
||
def get_inputs(self): | ||
return [] | ||
|
||
def get_outputs(self): | ||
return [] | ||
|
||
def run(self): | ||
path = os.path.abspath(os.getcwd()) | ||
cmd = [ | ||
"docker", | ||
"run", | ||
"--rm", | ||
f"-v={path}:/shared", | ||
"-w=/shared", | ||
"diracgrid/dirac-distribution", | ||
"/dirac-webapp-compile.py", | ||
"-D=/shared/src", | ||
"-n=WebAppDIRAC", | ||
] | ||
log.info('> %r', cmd) | ||
subprocess.check_call(cmd) | ||
|
||
|
||
class develop(_develop): | ||
def run(self): | ||
self.run_command("build_extjs_sources") | ||
super().run() | ||
|
||
|
||
class bdist_wheel(_bdist_wheel): | ||
def run(self): | ||
self.run_command("build_extjs_sources") | ||
super().run() | ||
|
||
|
||
cmdclass = { | ||
"develop": develop, | ||
"bdist_wheel": bdist_wheel, | ||
"build_extjs_sources": build_extjs_sources, | ||
} | ||
|
||
setup(cmdclass=cmdclass) | ||
setup(cmdclass=extjs_cmdclass) |