-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for lazy nodejs
installation
#13
Comments
Interesting ideas! They are sort of along the same route I was being to think about. I'm interested to explore how the The subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'nodejs-bin']) We could also check if the user has nvm, and if so has the correct version of node available. But I'm cautious of having too many options and moving parts. I want this to be simple, as you said They tricky part is tying into setup.py/requirements.txt version range pinning. What I want users to be able to do is specify a version range and that is what they get. Making this work "lazily" needs some thought: # requirements.txt
nodejs>=14.15.0,<16.2.0 It's "easy" to make a nodejs package for each released version that knows how to check if its own version is installed. But Ranges seems much more complex. If we can't solve that, then I would be inclined to suggest that we shouldn't go the lazy route at all. Your use case of needing node for you package, but not wanting the user to have to worry about how to install it is exactly the problem I'm trying to solve. There are so many projects using both Python on the backend, and Nodejs tooling for the front end, that building a unified venv that covers both makes the developers life easer. |
Ah I hadn't considered the complexities of version ranges. I think it should definitely be doable but would require more effort. Actually how were you thinking of letting users propagate the version range? That metadata wouldn't be easily accessible to the I think a good solution would be to make use of a [tool.nodejs]
version = ">=14.15.0,<16.2.0"
Were you thinking this would just use whatever the If so, I would have concerns about this as I think users wouldn't be particularly happy about a package automatically installing another package, even if they're related. I don't have any information backing this point up so it may be a non-issue. I think a better solution could be for This also has the advantage of potentially making supporting version ranges easier as it would make it easy for |
Hey! I'd love to be able to add this as a base dependency for my package which needs to interface with a Node-based CLI. However, I am wary of doing this as it adds ~150MB to the installation size which may be unnecessary if a user already has Node installed on their machine.
My current solution is to add this project as an extra which means users can easily install it if it would improve their experience, e.g.
This being optional means I need a solution to download Node if it isn't present on the user's machine, this led me to
nodeenv
which works for now but in an ideal world these would be handled by the same package.I don't think this would make sense for the current setup but when this project is changed to use the
nodejs
package name (#9) I think it could make a lot of sense to "namespace" the binary wheels, e.g. you would now install the binary distribution like this:In the "lazy" case it would essentially do the same thing that
nodeenv
does, downloading Node binaries at runtime. This could be handled transparently by both the CLI and the Python API with an explicit API as well, e.g.The text was updated successfully, but these errors were encountered: