Skip to content

Commit 18f5a3e

Browse files
Update README w/require_node_modules
1 parent ebdae1b commit 18f5a3e

File tree

2 files changed

+75
-3
lines changed

2 files changed

+75
-3
lines changed

README.ipynb

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"source": [
3636
"* [**Embed**](#Embed-node_modules/-in-Python-environments)\n",
3737
" **`node_modules/` in Python environments**\n",
38+
"* [**`require`**](#require_node_modules-in-setup.py)**`_node_modules`\n",
39+
" in setup.py** \n",
3840
"* [**Run**](#Run-installed-Node.js-tools-from-Python)\n",
3941
" **installed Node.js tools from Python**"
4042
]
@@ -68,7 +70,9 @@
6870
{
6971
"cell_type": "code",
7072
"execution_count": 1,
71-
"metadata": {},
73+
"metadata": {
74+
"collapsed": true
75+
},
7276
"outputs": [],
7377
"source": [
7478
"import nodely"
@@ -228,6 +232,45 @@
228232
"just `nodely.uninstall('coffee-script')` it"
229233
]
230234
},
235+
{
236+
"cell_type": "markdown",
237+
"metadata": {},
238+
"source": [
239+
"### `require_node_modules` in setup.py"
240+
]
241+
},
242+
{
243+
"cell_type": "markdown",
244+
"metadata": {},
245+
"source": [
246+
"Instead of installing Node.js packages during runtime,\n",
247+
"you can also define them as dependencies of your Python package:"
248+
]
249+
},
250+
{
251+
"cell_type": "markdown",
252+
"metadata": {},
253+
"source": [
254+
"```python\n",
255+
"from setuptools import setup\n",
256+
"\n",
257+
"setup(\n",
258+
" ...\n",
259+
" setup_requires=['nodely', ...],\n",
260+
" require_node_modules=['coffee-script', ...],\n",
261+
" ...\n",
262+
")\n",
263+
"```"
264+
]
265+
},
266+
{
267+
"cell_type": "markdown",
268+
"metadata": {},
269+
"source": [
270+
"So they get implicitly installed during the installation of the Python package,\n",
271+
"just like the Python dependencies defined in `install_requires`"
272+
]
273+
},
231274
{
232275
"cell_type": "markdown",
233276
"metadata": {},
@@ -239,7 +282,7 @@
239282
"cell_type": "markdown",
240283
"metadata": {},
241284
"source": [
242-
"The `nodely.call` function above additionally supports `subprocess.call` options:"
285+
"The `nodely.call` function additionally supports `subprocess.call` options:"
243286
]
244287
},
245288
{

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
* [**Embed**](#Embed-node_modules/-in-Python-environments)
2424
**`node_modules/` in Python environments**
25+
* [**`require`**](#require_node_modules-in-setup.py)**`_node_modules`
26+
in setup.py**
2527
* [**Run**](#Run-installed-Node.js-tools-from-Python)
2628
**installed Node.js tools from Python**
2729

@@ -137,11 +139,38 @@ just `nodely.uninstall('coffee-script')` it
137139

138140

139141

142+
### `require_node_modules` in setup.py
143+
144+
145+
146+
Instead of installing Node.js packages during runtime,
147+
you can also define them as dependencies of your Python package:
148+
149+
150+
151+
```python
152+
from setuptools import setup
153+
154+
setup(
155+
...
156+
setup_requires=['nodely', ...],
157+
require_node_modules=['coffee-script', ...],
158+
...
159+
)
160+
```
161+
162+
163+
164+
So they get implicitly installed during the installation of the Python package,
165+
just like the Python dependencies defined in `install_requires`
166+
167+
168+
140169
### Run installed Node.js tools from Python
141170

142171

143172

144-
The `nodely.call` function above additionally supports `subprocess.call` options:
173+
The `nodely.call` function additionally supports `subprocess.call` options:
145174

146175

147176

0 commit comments

Comments
 (0)