diff options
author | Thomas O'Donnell <andytom@users.noreply.github.com> | 2020-06-14 11:27:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 11:27:10 +0200 |
commit | 055986e2b1910fe7ed65dc1f058eaa2683046113 (patch) | |
tree | 62a29224e39daad05b7e9754e7111445e9ad7f86 /src/configs/python.rs | |
parent | b563d841c7db4d2b025d7b97339b7482bd442c05 (diff) |
feat(python): Add option to change the python binary (#1297)
* Add option to change the python binary
We are going to start to have problems with the python binary as python2
is removed and replaced with python3. To make the transition easier I
have added an option to the python module to allow the user to pick a
particular binary, e.g `python3`, for the module to use when selecting
the version of python. I have also refactored the python tests moving
almost all of them into the module and removing the dependency on the
version of python that is installed on the system.
* Add advanced config section to python module docs
Have added an advanced config section to the python module docs and
moved the `python_binary` option into that section.
Diffstat (limited to 'src/configs/python.rs')
-rw-r--r-- | src/configs/python.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/configs/python.rs b/src/configs/python.rs index bd986e91c..2b9aa4158 100644 --- a/src/configs/python.rs +++ b/src/configs/python.rs @@ -9,6 +9,7 @@ pub struct PythonConfig<'a> { pub version: SegmentConfig<'a>, pub pyenv_prefix: SegmentConfig<'a>, pub pyenv_version_name: bool, + pub python_binary: &'a str, pub scan_for_pyfiles: bool, pub style: Style, pub disabled: bool, @@ -21,6 +22,7 @@ impl<'a> RootModuleConfig<'a> for PythonConfig<'a> { version: SegmentConfig::default(), pyenv_prefix: SegmentConfig::new("pyenv "), pyenv_version_name: false, + python_binary: "python", scan_for_pyfiles: true, style: Color::Yellow.bold(), disabled: false, |