From 693465c0d182d06147d991cafd95712632e97a64 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Thu, 24 Jun 2021 14:24:15 +0200 Subject: [PATCH] Use dirac_webapp_packaging and DIRACWebAppResources --- pyproject.toml | 2 +- setup.cfg | 4 +-- setup.py | 66 +++----------------------------------------------- 3 files changed, 6 insertions(+), 66 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e749317d6..780998cc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/setup.cfg b/setup.cfg index 0cfa8d1f6..dac1f4118 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 5fc00b7d6..223944287 100644 --- a/setup.py +++ b/setup.py @@ -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)