-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
Milestone
Description
Refs:
- macOS @joshspicer
- linux @hawkticehurst
- windows @connor4312
Complexity: 5
🧪 Repo & Project Info
Extension Required: Python Environments Extension
Sample requirements.txt:
txt
Copy
Edit
requests==2.31.0
numpy==1.26.4
Multiroot Repos for Testing:
Single environment shared across folders and separate environment per folder: repo
🛠 Setup
- Open VS Code
- Confirm the Python Environments Extension is installed
- Open the Python side panel
- Click the “New Project” icon (📂➕ at the top of the panel)
✅ Part 1: Script Flow – No Environment Prompt
- Click "Create New"
- Choose “New Python Script”
- Confirm:
- A single .py file is created in the selected folder
- You are not prompted to create an environment
✅ Part 2: Package Flow – Auto Environment Creation
- create a requirements.txt file
- Click "Create New"
- Choose “New Python Package”
- Choose to create a venv as well
Confirm: - A folder is with your project name
- A virtual environment is created
- The interpreter is automatically selected
- the project shows up in your "python project" section with the right env
- Confirm your requirements.txt file is detected and its pkgs are installed
- vscode/settings.json incldues your new pkg
✅ Part 3: Multi-root Workspace Scenarios
🔹 Monorepo – Shared Environment Across Folders
- Open the workspace with multiple folders
- Run “New Project” in one subfolder and create an environment
- Confirm:
- Only one environment is created
- .vscode/settings.json is updated appropriately specifically that it has the workspace as an argument in settings object
- only one new project shows up in the "Python Project" UI