From 0a8083c6040b4c342355c0afb685a18569f611ee Mon Sep 17 00:00:00 2001 From: Brice Videau Date: Mon, 6 Jun 2022 20:36:24 -0500 Subject: Fix py-ray dependencies and build system (#31016) * Fix py-ray dependencies and build system * Update var/spack/repos/builtin/packages/py-ray/package.py Co-authored-by: Adam J. Stewart * Added documentation for unusual dependencies. * Fixed npm preinstall script per @adamjstewart suggestion. Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/py-ray/package.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-ray/package.py b/var/spack/repos/builtin/packages/py-ray/package.py index 8158d6fdda..33810602f1 100644 --- a/var/spack/repos/builtin/packages/py-ray/package.py +++ b/var/spack/repos/builtin/packages/py-ray/package.py @@ -18,11 +18,12 @@ class PyRay(PythonPackage): build_directory = 'python' - depends_on('python@3.6:', type=('build', 'run')) + depends_on('python@3.6:3.8', type=('build', 'run')) depends_on('bazel@3.2.0', type='build') depends_on('py-setuptools', type='build') depends_on('py-cython@0.29.14:', type='build') depends_on('py-wheel', type='build') + depends_on('npm', type='build') depends_on('py-aiohttp', type=('build', 'run')) depends_on('py-aioredis', type=('build', 'run')) depends_on('py-click@7.0:', type=('build', 'run')) @@ -42,3 +43,21 @@ class PyRay(PythonPackage): depends_on('py-redis@3.3.2:3.4', type=('build', 'run')) depends_on('py-opencensus', type=('build', 'run')) depends_on('py-prometheus-client@0.7.1:', type=('build', 'run')) + # If not guarded by SKIP_THIRDPARTY_INSTALL, those dependencies + # would be automatically installed via pip by the setup.py script. + depends_on('py-setproctitle', type=('build', 'run')) + depends_on('py-psutil', type=('build', 'run')) + # If not detected during install, the following dependency would + # be automatically downloaded and installed by the setup.py script. + depends_on('py-pickle5', when='^python@:3.8.1', type=('build', 'run')) + + def setup_build_environment(self, env): + env.set('SKIP_THIRDPARTY_INSTALL', '1') + + # Compile the dashboard npm modules included in the project + @run_before('install') + def build_dashboard(self): + with working_dir(join_path('python', 'ray', 'dashboard', 'client')): + npm = which('npm') + npm('ci') + npm('run', 'build') -- cgit v1.2.3-70-g09d2