diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8baa747243fd..d1fa56ca5b54 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -16,6 +16,17 @@ **REQUIRED CONDITIONS:** - To use Azure MCP tool calls, users must have PowerShell installed. Provide [PowerShell installation instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell) if not installed, and recommend restarting the IDE to start the MCP server. +### RULE 4: USE VIRTUAL ENVIRONMENTS +**ALWAYS run Python commands in a virtual environment (venv).** +- All Python operations (pip, tox, pytest, etc.) must be executed within an activated virtual environment +- Create a virtual environment using: `python -m venv env` +- Activate before running commands: + - Windows (PowerShell): `env\Scripts\Activate.ps1` + - Linux/Mac: `source env/bin/activate` + - Windows (CMD): `env\Scripts\activate.bat` +- Reference: [Python virtual environment documentation](https://docs.python.org/3/tutorial/venv.html) +- Reference: [Azure SDK dev setup guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/dev_setup.md) + --- ## PYLINT OPERATIONS @@ -26,8 +37,12 @@ - [Official pylint guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md) - [Tox formatting guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox) +**PREREQUISITES:** +- Ensure you are in an activated virtual environment before running pylint commands + **COMMAND:** ```bash +# After activating your virtual environment tox -e pylint --c --root . ``` @@ -64,6 +79,7 @@ tox -e pylint --c --root . - [MyPy fixing guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/static_type_checking_cheat_sheet.md) **REQUIREMENTS:** +- Ensure you are in an activated virtual environment before running MyPy commands - Use Python 3.9 compatible environment - Follow official fixing guidelines - Use tox mcp tool for running MyPy