You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains the script used to repackage the [releases][nodejsdl] of [Node.js][nodejs] as [Python binary wheels][wheel]. This document is intended for maintainers; see the [package README][pkgreadme] for rationale and usage instructions.
5
+
6
+
The repackaged artifacts are published as the [node-js PyPI package][pypi].
7
+
8
+
[nodejs]: https://nodejs.org/
9
+
[nodejsdl]: https://nodejs.org/en/download/
10
+
[wheel]: https://github.com/pypa/wheel
11
+
[pkgreadme]: README.pypi.md
12
+
[pypi]: https://pypi.org/project/node-js/
13
+
14
+
This tool is based on the work of the creators of the [Zig language][ziglang], see [the original][basedon]. Thank you to them!
15
+
16
+
[ziglang]: https://ziglang.org
17
+
[basedon]: https://github.com/ziglang/zig-pypi
18
+
19
+
Preparation
20
+
-----------
21
+
22
+
The script requires Python 3.5 or later.
23
+
24
+
Install the dependencies:
25
+
26
+
```shell
27
+
pip install wheel twine libarchive-c
28
+
```
29
+
30
+
The `libarchive-c` Python library requires the native [libarchive][] library to be available.
31
+
32
+
[libarchive]: https://libarchive.org/
33
+
34
+
Building wheels
35
+
---------------
36
+
37
+
Run the repackaging script:
38
+
39
+
```shell
40
+
python make_wheels.py
41
+
```
42
+
43
+
This command will download the Node.js release archives for every supported platform and convert them to binary wheels, which are placed under `dist/`. The Node.js version and platforms are configured in the script source.
44
+
45
+
The process of converting release archives to binary wheels is deterministic, and the output of the script should be bit-for-bit identical regardless of the environment and platform it runs under. To this end, it prints the SHA256 hashes of inputs and outputs; the hashes of the inputs will match the ones on the [Zig downloads page][nodejsdl], and the hashes of the outputs will match the ones on the [PyPI downloads page][pypidl].
46
+
47
+
[pypidl]: https://pypi.org/project/node-js/#files
48
+
49
+
Uploading wheels
50
+
----------------
51
+
52
+
Run the publishing utility:
53
+
54
+
```shell
55
+
twine dist/*
56
+
```
57
+
58
+
This command will upload the binary wheels built in the previous step to PyPI.
59
+
60
+
License
61
+
-------
62
+
63
+
This script is distributed under the terms of the [MIT (Expat) license](LICENSE.txt).
[Node.js][] is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.
5
+
6
+
The [node-js][pypi] Python package redistributes Node.js so that it can be used as a dependency of Python projects.
7
+
8
+
[zig]: https://nodejs.org/
9
+
[pypi]: https://pypi.org/project/node-js/
10
+
11
+
Usage
12
+
-----
13
+
14
+
To run the Zig toolchain from the command line, use:
15
+
16
+
```shell
17
+
python -m nodejs
18
+
```
19
+
20
+
To run Node.js from a Python program, use `sys.executable` to locate the Python binary to invoke. For example:
21
+
22
+
```python
23
+
import sys, subprocess
24
+
25
+
subprocess.call([sys.executable, "-m", "nodejs"])
26
+
```
27
+
28
+
License
29
+
-------
30
+
31
+
The [Node.js license](https://raw.githubusercontent.com/nodejs/node/master/LICENSE).
'Summary': 'Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.',
0 commit comments