@@ -125,7 +125,7 @@ def write_nodejs_wheel(out_dir, *, node_version, version, platform, archive):
125
125
126
126
if entry_name in NODE_BINS :
127
127
# entry_points['node'] = 'nodejs.node:main'
128
- init_imports .append ('from . import node' )
128
+ init_imports .append ('from . import node as node ' )
129
129
contents ['nodejs/node.py' ] = cleandoc (f"""
130
130
import os, sys, subprocess
131
131
from typing import TYPE_CHECKING
@@ -169,8 +169,8 @@ def main() -> None:
169
169
main()
170
170
""" ).encode ('ascii' )
171
171
elif entry_name in NODE_OTHER_BINS and NODE_OTHER_BINS [entry_name ][1 ]:
172
- # entry_points[NODE_OTHER_BINS[entry_name][0]] = f'nodejs.{ NODE_OTHER_BINS[entry_name][0]}:main'
173
- init_imports .append (f'from . import { NODE_OTHER_BINS [ entry_name ][ 0 ] } ' )
172
+ other_bin = NODE_OTHER_BINS [entry_name ][0 ]
173
+ init_imports .append (f'from . import { other_bin } as { other_bin } ' )
174
174
script_name = '/' .join (os .path .normpath (os .path .join (os .path .dirname (entry .name ), entry .linkpath )).split ('/' )[1 :])
175
175
contents [f'nodejs/{ NODE_OTHER_BINS [entry_name ][0 ]} .py' ] = cleandoc (f"""
176
176
import os, sys
@@ -208,8 +208,8 @@ def main() -> None:
208
208
main()
209
209
""" ).encode ('ascii' )
210
210
elif entry_name in NODE_OTHER_BINS :
211
- # entry_points[NODE_OTHER_BINS[entry_name][0]] = f'nodejs.{ NODE_OTHER_BINS[entry_name][0]}:main'
212
- init_imports .append (f'from . import { NODE_OTHER_BINS [ entry_name ][ 0 ] } ' )
211
+ other_bin = NODE_OTHER_BINS [entry_name ][0 ]
212
+ init_imports .append (f'from . import { other_bin } as { other_bin } ' )
213
213
contents [f'nodejs/{ NODE_OTHER_BINS [entry_name ][0 ]} .py' ] = cleandoc (f"""
214
214
import os, sys, subprocess
215
215
from typing import TYPE_CHECKING
@@ -246,7 +246,7 @@ def main() -> None:
246
246
""" ).encode ('ascii' )
247
247
248
248
contents ['nodejs/__init__.py' ] = (cleandoc ("""
249
- from .node import path, main, call, run, Popen
249
+ from .node import path as path , main as main , call as call , run as run, Popen as Popen
250
250
{init_imports}
251
251
252
252
__version__ = "{version}"
@@ -256,6 +256,7 @@ def main() -> None:
256
256
version = version ,
257
257
node_version = node_version ,
258
258
).encode ('ascii' )
259
+ contents ['nodejs/py.typed' ] = b''
259
260
260
261
with open ('README.md' ) as f :
261
262
description = f .read ()
0 commit comments