pongasoft / jamba

A lightweight VST2/3 framework
https://jamba.dev/
Apache License 2.0
122 stars 3 forks source link

jamba is for python 3.7+ #10

Closed mattetti closed 3 years ago

mattetti commented 3 years ago

The subprocess Python API has changed in v3.7 and over versions can't run the create-plugin.py script. While I believe switching the tooling to Go would be better from a user experience, I think a compromise might be to check the python version and gracefully exit with some explanations.

Traceback (most recent call last):
  File "../jamba/create-plugin.py", line 139, in <module>
    capture_output=True, text=True).stdout
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
ypujante commented 3 years ago

Thanks for reporting. I was not aware of the fact that APIs had changed in 3.7. It is indeed an oversight that Jamba is not even mentioning its dependency on python. Jamba was originally using shell scripts only but having to maintain a .sh and .bat was very difficult (especially since .bat are hard to write and very limited in what you can do). When I switched to python to make it cross platform I guess I missed a few obvious steps, like adding python as a requirement or fixing the doc (as you reported in #11)

I will change the script to detect the wrong version and fail properly which would be a better user experience.

You mention that "switching the tooling to Go would be better from a user experience". I don't have a lot of experience with Go besides a small project and I would appreciate if you could elaborate a bit more. Unless I am mistaken, Go is not an interpreted language so the user would have to a) install Go, then b) compile the various tools (there are 3 of them right now:create-plugin.py, configure.py and jamba.py). I am not sure why that would be a better user experience than a) install python, and no b) since you can just run the tools...

In addition, create-plugin.py is mostly here for the more advanced users as the recommended approach is to simply use the very user friendly web interface to create a brand new plugin.

mattetti commented 3 years ago

Thanks! The advantage of rewriting the python scripts in Go (or rust) is that you'd ship a standalone binary that'd be cross built from GitHub actions for instance. Go is popular for CLIs for this very reason. One wouldn't need to have python installed. It might be an overkill at this point but I thought of mention it since I remember having a discussion with you in a Go mailing list that a few years back.

ypujante commented 3 years ago

One of the issue is that jamba.py is actually dynamically generated based on the plugin (it contains replacement tokens that are injected from the build) and it couldn't be a generic tool. It would be hard to migrate and certainly overkill but I appreciate the suggestion.

mattetti commented 3 years ago

from what I saw in the code (jamba.py and configure.py), the only replacement tokens seem to be config options which could be stored in a json file. After all, those scripts seem to just be wrappers around cmake. Anyways, my concern was for Windows developers having to install python etc... Closing this issue, thanks again.