-
Notifications
You must be signed in to change notification settings - Fork 133
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
Makes the listen process configurable. #387
Conversation
Basic idea for making the listen process configurable for applications that embed python, but aren't python processes.
We already have a config property for this - it's "python" (with "pythonPath" as legacy spelling), it's just that it's currently only used for launch configurations, but we should repurpose that for attach. It also needs a test. Also, per #262 (comment), a useful heuristic is to probe |
Interesting, didn't see the other config, and from looking at the listen code, it would get rejected if I tried to use it with So Also for reference in our world editor: >>> sys.exec_prefix
'' So not sure what exactly we'd get out of that in this case. |
The stuff in As far as |
I think they'd still need to configure something with Blender seems to be the oddly well behaved one out of the bunch because for it, So something almost like this would need to be done. adapter_python = _config.get('python', sys.executable)
if not os.path.exists(adapter_python):
adapter_python = os.path.join(sys.exec_prefix, adapter_python) This sadly doesn't work if you're just saying "use the |
If "python" is specified explicitly, it should just be used with no modification, without trying to exists-check it. But for the cases where it's not specified, the default could be |
Okay, that feels better to me as well. So one other question, when it comes to adding a test for this, what is the best way to go about that? I've never worked with |
I've just realized that this would be very tricky to test, because it's a process used by the debug server to spawn the debug adapter, and the communication between the two is an implementation detail from the perspective of our (black box) tests. So, to observe the difference, the test would need to provide a wrapper around the actual Python interpreter that just registers the fact that it was invoked. Which is doable in principle - but it can't be an actual binary for the tests to remain platform-independent. We could probably rig something reasonably portable up with I'll think some more about it, but we can do the tests in another PR, so as not to block this one. |
Is the PR ready for merging, or are you planning on adding any more commits? |
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Basic idea for making the listen process configurable for applications
that embed python, but aren't python processes. Can help with #334