You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Settings Reference documentation and fix python-env.* naming inconsistency (#1114)
This PR does the following:
- Fix settings prefix inconsistency
Renames `python-env.*` settings to `python-envs.*` for consistency and
updates `package.json`, localization files, and source code accordingly.
- Improve Settings Reference documentation
Restructures the settings tables for clarity, adds missing documentation
for Python Environments settings, and clarifies supported values and
path resolution behavior.
- Clarify legacy settings and deprecation direction
Improves user-facing guidance on legacy Python settings, including
migration paths and deprecation notes, and documents the planned
replacement of terminal activation settings with
`python-envs.terminal.autoActivationType` based on discussion with
Anthony.
Here's what the readme looks like now.
<img width="1621" height="573" alt="image"
src="https://github.com/user-attachments/assets/7dd9608b-6c9c-4f85-b71f-41fdd95692cb"
/>
<img width="1620" height="469" alt="image"
src="https://github.com/user-attachments/assets/888e2b13-ca69-4cfa-bfd8-2359644962bb"
/>
| defaultEnvManager |`"ms-python.python:venv"`| The default environment manager used for creating and managing environments. |
131
-
| defaultPackageManager |`"ms-python.python:pip"`| The default package manager to use for installing and managing packages. This is often dictated by the default environment manager but can be customized. |
132
-
| pythonProjects |`[]`| A list of Python workspaces, specified by the path, in which you can set particular environment and package managers. You can set information for a workspace as `[{"path": "/path/to/workspace", "envManager": "ms-python.python:venv", "packageManager": "ms-python.python:pip"]}`. |
133
-
| terminal.showActivateButton |`false`| (experimental) Show a button in the terminal to activate/deactivate the current environment for the terminal. This button is only shown if the active terminal is associated with a project that has an activatable environment. |
134
-
| python-envs.terminal.autoActivationType |`command`| Specifies how the extension can activate an environment in a terminal. Utilizing Shell Startup requires changes to the shell script file and is only enabled for the following shells: zsh, fsh, pwsh, bash, cmd. When set to `command`, any shell can be activated. This setting applies only when terminals are created, so you will need to restart your terminals for it to take effect. To revert changes made during shellStartup, run `Python Envs: Revert Shell Startup Script Changes`. |
| defaultEnvManager |`"ms-python.python:venv"`| The default environment manager used for creating and managing environments. |
133
+
| defaultPackageManager |`"ms-python.python:pip"`| The default package manager to use for installing and managing packages. This is often dictated by the default environment manager but can be customized. |
134
+
| pythonProjects |`[]`| A list of Python workspaces, specified by the path, in which you can set particular environment and package managers. You can set information for a workspace as `[{"path": "/path/to/workspace", "envManager": "ms-python.python:venv", "packageManager": "ms-python.python:pip"]}`. |
135
+
| terminal.showActivateButton |`false`| (experimental) Show a button in the terminal to activate/deactivate the current environment for the terminal. This button is only shown if the active terminal is associated with a project that has an activatable environment. |
136
+
| terminal.autoActivationType |`"command"`| Specifies how the extension can activate an environment in a terminal. Accepted values: `command` (execute activation command in terminal), `shellStartup` (`terminal.integrated.shellIntegration.enabled` successfully enabled or we may modify shell startup scripts ), `off` (no auto-activation). Shell startup is only supported for: zsh, fish, pwsh, bash, cmd. **Takes precedence over**`python.terminal.activateEnvironment`. Restart terminals after changing this setting. To revert shell startup changes, run `Python Envs: Revert Shell Startup Script Changes`. |
137
+
| alwaysUseUv |`true`| When `true`, [uv](https://github.com/astral-sh/uv) will be used to manage all virtual environments if available. When `false`, uv will only manage virtual environments explicitly created by uv. |
138
+
| globalSearchPaths |`[]`| Global search paths for Python environments. Array of absolute directory paths to search for environments at the user level. This setting is merged with the legacy `python.venvPath` and `python.venvFolders` settings. |
139
+
| workspaceSearchPaths |`[]`| Workspace search paths for Python environments. Can be absolute paths or relative directory paths searched within the workspace. |
140
+
141
+
### Supported Legacy Python Settings (`python.`)
142
+
143
+
The following settings from the Python extension (`python.*`) are also supported by Python Environments.
| condaPath |`""`| Path to the conda executable. Used to locate and run conda for environment discovery and management. |
148
+
| defaultInterpreterPath |`"python"`| Path to the default Python interpreter. |
149
+
| envFile |`"${workspaceFolder}/.env"`| Path to the environment file (`.env`) containing environment variable definitions. Used with `python.terminal.useEnvFile` to inject environment variables into terminals. |
150
+
| terminal.activateEnvironment |`true`| Legacy setting for terminal auto-activation. If `python-envs.terminal.autoActivationType` is not set and this is `false`, terminal auto-activation will be disabled. **Superseded by**`python-envs.terminal.autoActivationType` which takes precedence when configured. |
151
+
| terminal.executeInFileDir |`false`| When `true`, the terminal's working directory will be set to the directory containing the Python file being executed, rather than the project root directory. |
152
+
| terminal.useEnvFile |`false`| Controls whether environment variables from `.env` files (specified by `python.envFile`) are injected into terminals. |
153
+
| venvFolders |`[]`| Array of folder names to search for virtual environments. These folders are searched in addition to the standard locations. **Note:** This setting is merged with `python-envs.globalSearchPaths`. Consider migrating to `python-envs.globalSearchPaths` for future compatibility. |
154
+
| venvPath |`""`| Path to a folder containing virtual environments. **Note:** This setting is merged with `python-envs.globalSearchPaths`. Consider migrating to `python-envs.globalSearchPaths` for future compatibility. |
Copy file name to clipboardExpand all lines: package.nls.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@
8
8
"python-envs.terminal.showActivateButton.description": "Whether to show the 'Activate' button in the terminal menu",
9
9
"python-envs.terminal.autoActivationType.description": "Specifies how the extension can activate an environment in a terminal.\n\nShell startup activates using [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) or may require changes to the shell initialization files and is only enabled for the following shells: zsh, fsh, pwsh, bash, cmd. When set to `command`, any shell can be activated.\n\n**Legacy Setting Support:** This setting takes precedence over the legacy `python.terminal.activateEnvironment` setting. If this setting is not explicitly set and `python.terminal.activateEnvironment` is set to false, this setting will automatically be set to `off` to preserve your preference.\n\nThis setting applies only when terminals are created, so you will need to restart your terminals for it to take effect.\n\nTo revert changes made during shellStartup, run `Python Envs: Revert Shell Startup Script Changes`.",
10
10
"python-envs.terminal.autoActivationType.command": "Activation by executing a command in the terminal.",
11
-
"python-envs.terminal.autoActivationType.shellStartup": "Activation by modifying the terminal shell startup script. To use this feature we will need to modify your shell startup scripts.",
11
+
"python-envs.terminal.autoActivationType.shellStartup": "Activation by modifying the terminal shell startup script. To use this feature we may need to modify your shell startup scripts and terminal.integrated.shellIntegration.enabled enabled for ideal experience.",
12
12
"python-envs.terminal.autoActivationType.off": "No automatic activation of environments.",
13
13
"python-envs.terminal.useEnvFile.description": "Controls whether environment variables from .env files and python.envFile setting are injected into terminals.",
14
-
"python-env.globalSearchPaths.description": "Global search paths for Python environments. Absolute directory paths that are searched at the user level.\n\n**Legacy Setting Support:** This setting is merged with the legacy `python.venvPath` and `python.venvFolders` settings. All paths from these three settings are combined into a single list of search paths. The legacy settings `python.venvPath` and `python.venvFolders` will be deprecated in the future, after which this setting will fully replace them. Please consider migrating your paths to this setting.",
15
-
"python-env.workspaceSearchPaths.description": "Workspace search paths for Python environments. Can be absolute paths or relative directory paths searched within the workspace.",
14
+
"python-envs.globalSearchPaths.description": "Global search paths for Python environments. Absolute directory paths that are searched at the user level.\n\n**Legacy Setting Support:** This setting is merged with the legacy `python.venvPath` and `python.venvFolders` settings. All paths from these three settings are combined into a single list of search paths. The legacy settings `python.venvPath` and `python.venvFolders` will be deprecated in the future, after which this setting will fully replace them. Please consider migrating your paths to this setting.",
15
+
"python-envs.workspaceSearchPaths.description": "Workspace search paths for Python environments. Can be absolute paths or relative directory paths searched within the workspace.",
'Error: python-env.workspaceSearchPaths is set at the user/global level, but this setting can only be set at the workspace or workspace folder level.',
479
+
'Error: python-envs.workspaceSearchPaths is set at the user/global level, but this setting can only be set at the workspace or workspace folder level.',
0 commit comments