Skip to content

Commit ecbb152

Browse files
cwebster-99eleanorjboyd
authored andcommitted
Update readme based on most recent updates (microsoft#368)
1 parent eda57fb commit ecbb152

File tree

2 files changed

+81
-34
lines changed

2 files changed

+81
-34
lines changed

README.md

Lines changed: 81 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,103 @@
1-
# Python Environments and Package Manager (experimental)
1+
# Python Environments (experimental)
22

33
## Overview
44

5-
The Python Environments and Package Manager extension for VS Code helps you manage Python environments and packages using your preferred environment manager backed by its extensible APIs. This extension provides unique support to specify environments for specific files or whole Python folders or projects, including multi-root & mono-repos scenarios.
5+
The Python Environments extension for VS Code helps you manage Python environments and packages using your preferred environment manager, backed by its extensible APIs. This extension provides unique support for specifying environments for specific files, entire Python folders, or projects, including multi-root and mono-repo scenarios. The core feature set includes:
66

7-
> Note: This extension is in preview and its APIs and features are subject to change as the project continues to evolve.
7+
- 🌐 Create, delete, and manage environments
8+
- 📦 Install and uninstall packages within the selected environment
9+
- ✅ Create activated terminals
10+
- 🖌️ Add and create new Python projects
811

9-
> Important: This extension currently requires the pre-release version of the Python extension (ms-python.python) to operate (version 2024.23.2025010901 or later).
12+
> **Note:** This extension is in preview, and its APIs and features are subject to change as the project evolves.
13+
14+
> **Important:** This extension requires version `2024.23`, or later, of the Python extension (`ms-python.python`).
1015
1116
## Features
1217

13-
<img src=https://raw.githubusercontent.com/microsoft/vscode-python-environments/main/images/python-envs-overview.gif width=734 height=413>
18+
The "Python Projects" fold shows you all of the projects that are currently in your workspace and their selected environments. From this view you can add more files or folders as projects, select a new environment for your project, and manage your selected environments.
19+
20+
The "Environment Managers" fold shows you all of the environment managers that are available on your machine with all related environments nested below. From this view, you can create new environments, delete old environments, and manage packages.
21+
22+
<img src=<https://raw.githubusercontent.com/microsoft/vscode-python-environments/main/images/python-envs-overview.gif> width=734 height=413>
1423

1524
### Environment Management
1625

17-
This extension provides an Environments view, which can be accessed via the VS Code Activity Bar, where you can manage your Python environments. Here, you can create, delete, and switch between environments, as well as install and uninstall packages within the selected environment. It also provides APIs for extension developers to contribute their own environment managers.
26+
The Python Environments panel provides an interface to create, delete and manage environments.
27+
28+
<img src=<https://raw.githubusercontent.com/microsoft/vscode-python-environments/main/images/environment-managers-quick-start.png> width=734 height=413>
29+
30+
To simplify the environment creation process, you can use "Quick Create" to automatically create a new virtual environment using:
1831

19-
By default, the extension uses the `venv` environment manager. This default manager determines how environments are created, managed, and where packages are installed. However, users can change the default by setting the `python-envs.defaultEnvManager` to a different environment manager. The following environment managers are supported out of the box:
32+
- Your default environment manager (e.g., `venv`)
33+
- The latest Python version
34+
- Workspace dependencies
2035

21-
| Id | name | Description |
36+
For more control, you can create a custom environment where you can specify Python version, environment name, packages to be installed, and more!
37+
38+
The following environment managers are supported out of the box:
39+
40+
| Id | Name | Description |
2241
| ----------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2342
| ms-python.python:venv | `venv` | The default environment manager. It is a built-in environment manager provided by the Python standard library. |
2443
| ms-python.python:system | System Installed Python | These are global Python installs on your system. These are typically installed with your OS, from [python.org](https://www.python.org/), or any other OS package manager. |
2544
| ms-python.python:conda | `conda` | The [conda](https://conda.org) environment manager, as provided by conda distributions like [Anaconda Distribution](https://docs.anaconda.com/anaconda/) or [conda-forge](https://conda-forge.org/download/). |
2645

27-
The environment manager is responsible for specifying which package manager will be used by default to install and manage Python packages within the environment. This ensures that packages are managed consistently according to the preferred tools and settings of the chosen environment manager.
46+
Environment managers are responsible for specifying which package manager will be used by default to install and manage Python packages within the environment (`venv` uses `pip` by default). This ensures that packages are managed consistently according to the preferred tools and settings of the chosen environment manager.
2847

2948
### Package Management
3049

31-
This extension provides a package view for you to manage, install and uninstall you Python packages in any particular environment. This extension provides APIs for extension developers to contribute package managers.
50+
The extension also provides an interface to install and uninstall Python packages, and provides APIs for extension developers to contribute package managers of their choice.
3251

33-
The extension uses `pip` as the default package manager. You can change this by setting the `python-envs.defaultPackageManager` setting to a different package manager. The following are package managers supported out of the box:
52+
The extension uses `pip` as the default package manager, but you can use the package manager of your choice using the `python-envs.defaultPackageManager` setting. The following are package managers supported out of the box:
3453

35-
| Id | name | Description |
54+
| Id | Name | Description|
3655
| ---------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3756
| ms-python.python:pip | `pip` | Pip acts as the default package manager and it's typically built-in to Python. |
3857
| ms-python.python:conda | `conda` | The [conda](https://conda.org) package manager, as provided by conda distributions like [Anaconda Distribution](https://docs.anaconda.com/anaconda/) or [conda-forge](https://conda-forge.org/download/). |
3958

59+
### Project Management
60+
61+
A "Python Project" is any file or folder that contains runnable Python code and needs its own environment. With the Python Environments extension, you can add files and folders as projects in your workspace and assign individual environments to them allowing you to run various projects more seamlessly.
62+
63+
Projects can be added via the Python Environments pane or in the File Explorer by right-clicking on the folder/file and selecting the "Add as Python Project" menu item.
64+
65+
There are a couple of ways that you can add a Python Project from the Python Environments panel:
66+
67+
| Name | Description |
68+
| ----- | ---------- |
69+
| Add Existing | Allows you to add an existing folder from the file explorer. |
70+
| Auto find | Searches for folders that contain `pyproject.toml` or `setup.py` files |
71+
72+
## Command Reference
73+
74+
| Name | Description |
75+
| -------- | ------------- |
76+
| Python: Create Environment | Create a virtual environment using your preferred environment manager preconfigured with "Quick Create" or configured to your choices. |
77+
| Python: Manage Packages | Install and uninstall packages in a given Python environment. |
78+
| Python: Activate Environment in Current Terminal | Activates the currently opened terminal with a particular environment. |
79+
| Python: Deactivate Environment in Current Terminal | Deactivates environment in currently opened terminal. |
80+
| Python: Run as Task | Runs Python module as a task. |
81+
4082
## Settings Reference
4183

4284
| Setting (python-envs.) | Default | Description |
4385
| --------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44-
| defaultEnvManager | `"ms-python.python:venv"` | The default environment manager used for creating and managing environments. |
45-
| 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. |
86+
| defaultEnvManager | `"ms-python.python:venv"` | The default environment manager used for creating and managing environments. |
87+
| 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. |
4688
| 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"]}`. |
47-
| 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. |
89+
| 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. |
90+
| 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`.|
91+
92+
## Extensibility
4893

49-
## API Reference (proposed)
94+
The Python Environments extension was built to provide a cohesive and user friendly experience with `venv` as the default. However, the extension is built with extensibility in mind so that any environment manager could build an extension using the supported APIs to plug-in and provide a seamless and incorporated experience for their users in VS Code.
95+
96+
### API Reference (proposed)
5097

5198
See [api.ts](https://github.com/microsoft/vscode-python-environments/blob/main/src/api.ts) for the full list of Extension APIs.
5299

53-
To consume these APIs you can look at the example here:
54-
https://github.com/microsoft/vscode-python-environments/blob/main/examples/README.md
100+
To consume these APIs you can look at the example here: [API Consumption Examples](https://github.com/microsoft/vscode-python-environments/blob/main/examples/README.md)
55101

56102
### Callable Commands
57103

@@ -77,23 +123,24 @@ Create a new environment using any of the available environment managers. This c
77123

78124
usage: `await vscode.commands.executeCommand('python-envs.createAny', options);`
79125

126+
80127
## Extension Dependency
81128

82129
This section provides an overview of how the Python extension interacts with the Python Environments extension and other tool-specific extensions. The Python Environments extension allows users to create, manage, and remove Python environments and packages. It also provides an API that other extensions can use to support environment management or consume it for running Python tools or projects.
83130

84131
Tools that may rely on these APIs in their own extensions include:
85132

86-
- **Debuggers** (e.g., `debugpy`)
87-
- **Linters** (e.g., Pylint, Flake8, Mypy)
88-
- **Formatters** (e.g., Black, autopep8)
89-
- **Language Server extensions** (e.g., Pylance, Jedi)
90-
- **Environment and Package Manager extensions** (e.g., Pixi, Conda, Hatch)
133+
- **Debuggers** (e.g., `debugpy`)
134+
- **Linters** (e.g., Pylint, Flake8, Mypy)
135+
- **Formatters** (e.g., Black, autopep8)
136+
- **Language Server extensions** (e.g., Pylance, Jedi)
137+
- **Environment and Package Manager extensions** (e.g., Pixi, Conda, Hatch)
91138

92139
### API Dependency
93140

94141
The relationship between these extensions can be represented as follows:
95142

96-
<img src=https://raw.githubusercontent.com/microsoft/vscode-python-environments/refs/heads/main/images/extension_relationships.png width=734 height=413>
143+
<img src=<https://raw.githubusercontent.com/microsoft/vscode-python-environments/refs/heads/main/images/extension_relationships.png> width=734 height=413>
97144

98145
Users who do not need to execute code or work in **Virtual Workspaces** can use the Python extension to access language features like hover, completion, and go-to definition. However, executing code (e.g., running a debugger, linter, or formatter), creating/modifying environments, or managing packages requires the Python Environments extension to enable these functionalities.
99146

@@ -103,15 +150,15 @@ VS Code supports trust management, allowing extensions to function in either **t
103150

104151
The relationship is illustrated below:
105152

106-
<img src=https://raw.githubusercontent.com/microsoft/vscode-python-environments/refs/heads/main/images/trust_relationships.png width=734 height=413>
153+
<img src=<https://raw.githubusercontent.com/microsoft/vscode-python-environments/refs/heads/main/images/trust_relationships.png> width=734 height=413>
107154

108155
In **trusted mode**, the Python Environments extension supports tasks like managing environments, installing/removing packages, and running tools. In **untrusted mode**, functionality is limited to language features, ensuring a secure and restricted environment.
109156

110157
## Contributing
111158

112159
This project welcomes contributions and suggestions. Most contributions require you to agree to a
113160
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
114-
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
161+
the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
115162

116163
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
117164
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
@@ -123,17 +170,17 @@ contact [[email protected]](mailto:[email protected]) with any additio
123170

124171
## Questions, issues, feature requests, and contributions
125172

126-
- If you have a question about how to accomplish something with the extension, please [ask on our Discussions page](https://github.com/microsoft/vscode-python/discussions/categories/q-a).
127-
- If you come across a problem with the extension, please [file an issue](https://github.com/microsoft/vscode-python).
128-
- Contributions are always welcome! Please see our [contributing guide](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md) for more details.
129-
- Any and all feedback is appreciated and welcome!
130-
- If someone has already [filed an issue](https://github.com/Microsoft/vscode-python) that encompasses your feedback, please leave a 👍/👎 reaction on the issue.
131-
- Otherwise please start a [new discussion](https://github.com/microsoft/vscode-python/discussions/categories/ideas).
132-
- If you're interested in the development of the extension, you can read about our [development process](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md#development-process).
173+
- If you have a question about how to accomplish something with the extension, please [ask on our Discussions page](https://github.com/microsoft/vscode-python/discussions/categories/q-a).
174+
- If you come across a problem with the extension, please [file an issue](https://github.com/microsoft/vscode-python).
175+
- Contributions are always welcome! Please see our [contributing guide](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md) for more details.
176+
- Any and all feedback is appreciated and welcome!
177+
- If someone has already [filed an issue](https://github.com/Microsoft/vscode-python) that encompasses your feedback, please leave a 👍/👎 reaction on the issue.
178+
- Otherwise please start a [new discussion](https://github.com/microsoft/vscode-python/discussions/categories/ideas).
179+
- If you're interested in the development of the extension, you can read about our [development process](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md#development-process).
133180

134181
## Data and telemetry
135182

136-
The Microsoft Python Extension for Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/privacystatement) to learn more. This extension respects the `telemetry.enableTelemetry` setting which you can learn more about at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.
183+
The Microsoft Python Extension for Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/privacystatement) to learn more. This extension respects the `telemetry.enableTelemetry` setting which you can learn more about at <https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting>.
137184

138185
## Trademarks
139186

144 KB
Loading

0 commit comments

Comments
 (0)