Skip to content

Commit

Permalink
Use dirac_webapp_packaging and DIRACWebAppResources
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Jun 24, 2021
1 parent 1c145b7 commit 693465c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 66 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
requires = ["dirac_webapp_packaging~=1.0", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

# Enable setuptools_scm to compute the version number from the most recent tag
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ classifiers =
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering
Topic :: System :: Distributed Computing

[options]
python_requires = >=3.8
python_requires = >=3.9
package_dir=
=src
packages = find:

install_requires =
DIRACWebAppResources ~=1.0
dirac ~=7.3.0a0
diraccfg
requests >=2.9.1
Expand Down
66 changes: 3 additions & 63 deletions setup.py
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)

0 comments on commit 693465c

Please sign in to comment.