Skip to content

Commit

Permalink
Add variant typescript for py-jupyter-server@:1, which then requires …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
climbfuji committed Mar 19, 2024
1 parent dbc8d59 commit ca02e13
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"]

11 changes: 11 additions & 0 deletions var/spack/repos/builtin/packages/py-jupyter-server/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ 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",
)

# https://github.com/spack/spack/issues/41899
patch("no_npm_node.patch", when="@: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
Expand All @@ -37,6 +47,7 @@ class PyJupyterServer(PythonPackage):
depends_on("py-jupyter-packaging@0.9:0", when="@1.6.2:", type="build")
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"))
Expand Down

0 comments on commit ca02e13

Please sign in to comment.