Skip to content
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 settings for PYTHONPATH and python executable #11

Open
CaribouJohn opened this issue Aug 24, 2020 · 4 comments
Open

Add settings for PYTHONPATH and python executable #11

CaribouJohn opened this issue Aug 24, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@CaribouJohn
Copy link
Contributor

CaribouJohn commented Aug 24, 2020

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 ...

@CaribouJohn CaribouJohn added the enhancement New feature or request label Aug 24, 2020
@ben-spiller
Copy link
Contributor

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
Copy link
Contributor Author

Changed param

@CaribouJohn CaribouJohn changed the title Add settings for PYTHON_PATH and python executable Add settings for PYTHONPATH and python executable Aug 25, 2020
@CaribouJohn CaribouJohn self-assigned this Sep 3, 2020
@CaribouJohn
Copy link
Contributor Author

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.

@CaribouJohn CaribouJohn removed their assignment Mar 31, 2021
@ben-spiller
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants