ApamaCommunity / pysys-vscode-extension

This is a vscode extension for the pysys framwork it enables the use of this testing framework in Visual Studio Code allowing the use of the UI to interact with and create tests for your software projects..
https://cariboujohn.github.io/pysys-vscode-extension/
4 stars 4 forks source link

Add settings for PYTHONPATH and python executable #11

Open CaribouJohn opened 4 years ago

CaribouJohn commented 4 years ago

To help the user we should allow them to override the default python on the path with their own choice. This should be explicitly overridden not set by default.

Setting name Description
pysys-test.python Path to python executable to use
pysys-test.pythonpath PYTHON_PATH that will be appended to the environment variable currently set

These settings will replace the default command used when invoking commands. Where we currently use

python -m pysys

If the python executable is set to be

/mypath/bin/python or c:\myWindowsPath\bin\python.exe we should use these

/mypath/bin/python -m pysys ...

ben-spiller commented 4 years ago

NB: it's PYTHONPATH/pythonpath not PYTHON_PATH Might be good to call the other setting python_exe or similar to avoid confusion with pythonpath? (python's fault for picking a confusing name :) )

CaribouJohn commented 4 years ago

Changed param

CaribouJohn commented 4 years ago

Added

        "configuration": {
            "title": "Python settings for Pysys",
            "properties": {
                "pysys.interpreter_path": {
                    "type": "string",
                    "description": "Path to Python that has Pysys installed. This overrides the default of using python on the PATH."
                },
                "pysys.PYTHONPATH": {
                    "type": "string",
                    "description": "PYTHONPATH will be *Added* to the environment when running pysys."
                }
            }

interpreter_path will now effect the python used to invoke pysys.

Need to add handling for PYTHONPATH so that it will be added to the environment when the pysys command runs.

ben-spiller commented 1 year ago

We should also consider fitting in with what the Python VSCode plugin does e.g. use a .env file and/or venv (https://code.visualstudio.com/docs/python/environments#:~:text=In%20VS%20Code%2C%20PYTHONPATH%20can%20be%20set%20through,is%20routed%20through%20the%20terminal%20such%20as%20debugging) - would be good to recommend a single approach that would work for both, since they'll almost always be used together