Skip to content

Commit

Permalink
add nodejs-wheel
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 28, 2024
1 parent fc3bef3 commit ef28071
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
25 changes: 25 additions & 0 deletions recipes/nodejs-wheel/0001-hack-ROOT_DIR.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From da61816c3a41ffbf8381c04b6df5e4aada262e01 Mon Sep 17 00:00:00 2001
From: Jinzhe Zeng <[email protected]>
Date: Thu, 28 Nov 2024 18:44:21 -0500
Subject: [PATCH] hack ROOT_DIR

---
nodejs_wheel/executable.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nodejs_wheel/executable.py b/nodejs_wheel/executable.py
index 42f216e..dede038 100644
--- a/nodejs_wheel/executable.py
+++ b/nodejs_wheel/executable.py
@@ -10,7 +10,7 @@ try:
except ImportError:
from typing_extensions import Literal # type: ignore

-ROOT_DIR = os.path.dirname(__file__)
+ROOT_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")


@overload
--
2.34.1

56 changes: 56 additions & 0 deletions recipes/nodejs-wheel/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set name = "nodejs-wheel" %}
{% set version = "22.11.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/njzjz/nodejs-wheel/archive/v{{ version }}.tar.gz
sha256: 66a58de579f1d2fb64aa021ef324877375beb0b86596d4ddb4edfadcbb714f81
patches:
- 0001-hack-ROOT_DIR.patch

build:
noarch: python
number: 0
script_env:
- SETUPTOOLS_SCM_PRETEND_VERSION={{version}}
- SKBUILD_WHEEL_CMAKE=0
script: "{{ PYTHON }} -m pip install . -vv"

requirements:
host:
- python {{ python_min }}
- pip
- scikit-build-core
run:
- python >={{ python_min }}
# unpin nodejs, so downstream packages can control the version
- nodejs

test:
imports:
- nodejs_wheel
requires:
- python {{ python_min }}
- pip
commands:
- python -m nodejs_wheel --version
- pip check

about:
home: https://github.com/njzjz/nodejs-wheel
summary: 'Python wrapper for Node.js wheels'
description: |
On PyPI, nodejs-wheel is unoffical Node.js wheels;
on conda-forge, only the Python wrapper is provided.
license: MIT
license_family: MIT
license_file: LICENSE
doc_url: https://github.com/njzjz/nodejs-wheel
dev_url: https://github.com/njzjz/nodejs-wheel

extra:
recipe-maintainers:
- njzjz
15 changes: 15 additions & 0 deletions recipes/nodejs-wheel/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from nodejs_wheel import (
node,
npm,
npx,
)


return_code0 = node(["--version"])
assert return_code0 == 0

return_code1 = npm(["--version"])
assert return_code1 == 0

return_code2 = npx(["--version"])
assert return_code2 == 0

0 comments on commit ef28071

Please sign in to comment.