nodejs-pypi
nodejs-pypi copied to clipboard
Fix the python api in order to release none alpha versions
As our release versions match that of the bundled node we can't [^0] update the API after we realise a none alpha version.
Therefore we need to ensure the API is fixed and will never change. I want to address these concerns first:
-
We wrap the subprocess
run
,call
, andPopen
commands, do we want to wrap any others? Is there a way to make it forward compatible by inspecting and automatically wrapping the subprocess api? -
The path of the main 'node' command is available as
from nodejs import node; node.path
, this is nicely forward compatible. The other commands (npm, npx, corepack) do not currently make their path available as there are two different ways they work.- On Windows these are executables, and so we could easily make the path available
- On Linux/Unix they are a js script that is run by node, this isn't easily made available as a
path
.
The question is, do we convert
path
to a tuple in all cases (including fornode
), so for a simple executable it's just('path/of/bin')
, but for scripts it would be('path/to/node', 'script/to/run')
? This would ensure it's possible to retrieve the path/script and run with any other execution api. If we do this is there a better name thenpath
?path_args
,paths
?
[^0]: It is technically possible to update a package on PyPI with the same version by changing the build number, we should reserve this for replacing broken wheels.