mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
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.
This commit is contained in:
+20
-1
@@ -1225,6 +1225,25 @@ The module will be shown if any of the following conditions are met:
|
||||
| `style` | `"bold yellow"` | The style for the module. |
|
||||
| `disabled` | `false` | Disables the `python` module. |
|
||||
|
||||
<details>
|
||||
<summary>This module has some advanced configuration options.</summary>
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --------------- | -------- | ---------------------------------------------------------------------------- |
|
||||
| `python_binary` | `python` | Confgures the python binary that Starship executes when getting the version. |
|
||||
|
||||
The `python_binary` variable changes the binary that Starship executes to get
|
||||
the version of Python, it doesn't change the arguments that are used.
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
[python]
|
||||
python_binary = "python3"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Example
|
||||
|
||||
```toml
|
||||
@@ -1480,7 +1499,7 @@ will simply show all custom modules in the order they were defined.
|
||||
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
|
||||
|
||||
If `shell` is not given or only contains one element and Starship detects PowerShell will be used,
|
||||
the following arguments will automatically be added: `-NoProfile -Command -`.
|
||||
the following arguments will automatically be added: `-NoProfile -Command -`.
|
||||
This behavior can be avoided by explicitly passing arguments to the shell, e.g.
|
||||
|
||||
```toml
|
||||
|
||||
Reference in New Issue
Block a user