-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Write a wiki page for monorepo setups #21969
Comments
Below is the proposal of what we'd add to the Python extension wiki page: Python in VS Code – Mono Repo Set-up GuideThis guide will walk you through the process of setting up a Python mono repo in Visual Studio Code for two different dependency management scenarios. Scenario 1: Shared DependenciesThere are cases where all the projects under the root folder of a mono repo don't have conflicting dependencies, which means they can all be installed successfully into the same virtual environment. In such scenarios, you can just open the mono repo root folder in VS Code, create a virtual environment at the root folder level, and install all the project dependencies. Example repo: Azure SDK for Python repo Set up stepsIn VS Code, open the mono repo folder in VS Code:
Then create a virtual environment:
Scenario 2: Separate Virtual EnvironmentsIn cases where each project folder may have different dependencies that may conflict with each other, and therefore can't be installed in the same virtual environment, you can take advantage of multi-root workspaces. Example repo: Responsible AI Toolbox Set up stepsIn VS Code, open one of the project folders in your mono repo in VS Code:
Then add the remaining project folders to this workspace:
For each project within your multi-root workspace you want to work on, create a virtual environment:
If the root folder contains files or metadata you need for your development, you can also open it as a separate workspace. To avoid having duplicated files and directories in the File Explorer view, you can set up the
If for some reason multi-root workspaces aren't a good fit for your use case, there are a few helpful extensions that may offer a suitable workaround for your workflow if you open the root folder of your mono repo as a folder in VS Code:
If none of these work for you, we would appreciate it if you could share a comment to #21204 providing more details about your workflow and project structure. We are always looking for ways to improve the Python extension and your feedback is very valuable to us! |
Made some small grammar edits inline otherwise the content LGTM! |
@cwebster-99 thank you so much! |
Related to #21204
There are a couple of existing workarounds to manage mono repos with Python, and a few extensions that can be helpful. This issue is to track documenting them into a page in our wiki
The text was updated successfully, but these errors were encountered: