summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDom Heinzeller <dom.heinzeller@icloud.com>2024-03-20 08:03:18 -0600
committerGitHub <noreply@github.com>2024-03-20 08:03:18 -0600
commit2f0a73f7efe24a7001bf99465e32f1060ab389d5 (patch)
tree684cbb7d69022781e74ea7ff688669ddf836bcb0 /var
parent7cb0dbf77a155a0a2a30448b28dde1036cf21962 (diff)
downloadspack-2f0a73f7efe24a7001bf99465e32f1060ab389d5.tar.gz
spack-2f0a73f7efe24a7001bf99465e32f1060ab389d5.tar.bz2
spack-2f0a73f7efe24a7001bf99465e32f1060ab389d5.tar.xz
spack-2f0a73f7efe24a7001bf99465e32f1060ab389d5.zip
Define variant `typescript` for py-jupyter-server with explicit dependency on `npm` (#43279)
* Add variant typescript for py-jupyter-server@:1, which then requires npm/node. Patch the build system for ~typescript so that it doesn't find any npm/node installations and attempts to build the typescript extension even though it shouldn't * Fix formatting in var/spack/repos/builtin/packages/py-jupyter-server/package.py * Constrain typescript variant to py-jupyter-server versions 1.10.2:1 * with when not needed if variant doesn't exist for other versions
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-jupyter-server/no_npm_node.patch14
-rw-r--r--var/spack/repos/builtin/packages/py-jupyter-server/package.py6
2 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-jupyter-server/no_npm_node.patch b/var/spack/repos/builtin/packages/py-jupyter-server/no_npm_node.patch
new file mode 100644
index 0000000000..251acbd44b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-jupyter-server/no_npm_node.patch
@@ -0,0 +1,14 @@
+--- a/pyproject.toml 2024-03-19 15:58:20.000000000 -0600
++++ b/pyproject.toml 2024-03-19 15:59:15.000000000 -0600
+@@ -5,6 +5,11 @@
+ [tool.jupyter-packaging.builder]
+ factory = "jupyter_packaging.npm_builder"
+
++# Injected by spack to solve problems with hidden npm/node dependencies
++# https://github.com/spack/spack/issues/41899
++[tool.jupyter-packaging.build-args]
++npm = "/dev/null"
++
+ [tool.check-manifest]
+ ignore = ["tbump.toml", ".*", "*.yml", "package-lock.json", "bootstrap*", "conftest.py"]
+
diff --git a/var/spack/repos/builtin/packages/py-jupyter-server/package.py b/var/spack/repos/builtin/packages/py-jupyter-server/package.py
index 87afeb95f6..669ef586d1 100644
--- a/var/spack/repos/builtin/packages/py-jupyter-server/package.py
+++ b/var/spack/repos/builtin/packages/py-jupyter-server/package.py
@@ -28,6 +28,11 @@ class PyJupyterServer(PythonPackage):
version("1.9.0", sha256="7d19006380f6217458a9db309b54e3dab87ced6c06329c61823907bef2a6f51b")
version("1.6.1", sha256="242ddd0b644f10e030f917019b47c381e0f2d2b950164af45cbd791d572198ac")
+ variant("typescript", default=False, description="Build the typescript code", when="@1.10.2:1")
+
+ # https://github.com/spack/spack/issues/41899
+ patch("no_npm_node.patch", when="@1.10.2:1 ~typescript")
+
depends_on("python@3.8:", when="@2:", type=("build", "run"))
depends_on("py-hatchling@1.11:", when="@2:", type="build")
# under [tool.hatch.build.hooks.jupyter-builder] in pyproject.toml
@@ -38,6 +43,7 @@ class PyJupyterServer(PythonPackage):
depends_on("py-pre-commit", when="@1.16:", type="build")
depends_on("py-setuptools", type="build")
+ depends_on("npm", type="build", when="+typescript")
depends_on("py-anyio@3.1.0:", when="@2.2.1:", type=("build", "run"))
depends_on("py-anyio@3.1.0:3", when="@:2.2.0", type=("build", "run"))
depends_on("py-argon2-cffi", type=("build", "run"))