NEVER repeat instructions when guiding users. Users should follow instructions independently.
ALWAYS reference the Azure SDK Python Design Guidelines
- Link to specific pages when answering guidelines questions
- Use this as the authoritative source for SDK development guidance
REQUIRED CONDITIONS:
- Always activate the Python virtual environment before running Python commands:
- On Windows:
.venv\Scripts\activate - On Linux/macOS:
source .venv/bin/activate
- On Windows:
- Use
python -m pipinstead of barepipwhen installing packages.
Install all dependencies with:
python -m pip install -e ".[dev,test]"This project requires Python 3.10 or newer.
featuremanagement/— Synchronous feature management codefeaturemanagement/aio/— Async equivalents of feature management classesfeaturemanagement/_models/— Data models (feature flags, variants, telemetry)featuremanagement/_time_window_filter/— Time window filter with recurrence supportfeaturemanagement/azuremonitor/— Optional Azure Monitor telemetry integrationtests/— Unit tests (sync and async)samples/— Sample applications
- All source files must include the Microsoft copyright header.
- All modules must have a module-level docstring.
- Maximum line length is 120 characters.
- Use type annotations on all functions and methods.
COMMAND:
black featuremanagementLine length is configured to 120 in pyproject.toml.
Always run black before pylint and mypy, as formatting fixes can resolve issues those tools detect.
COMMAND:
pylint featuremanagementALLOWED ACTIONS:
- ✅ Fix warnings with 100% confidence
- ✅ Use existing files for all solutions
- ✅ Reference official guidelines
FORBIDDEN ACTIONS:
- ❌ Fix warnings without complete confidence
- ❌ Create new files for solutions
- ❌ Import non-existent modules
- ❌ Add new dependencies/imports
- ❌ Make unnecessary large changes
- ❌ Change code style without reason
- ❌ Delete code without clear justification
COMMAND:
mypy featuremanagementThe project uses strict = True in mypy.ini.
COMMAND:
pytest tests- Sync tests are in
tests/test_*.py - Async tests use
pytest-asyncioand are in files ending with_async.py - Run tests with:
pytest tests
When adding a new user-facing feature or capability:
- Create a sample in
samples/demonstrating the feature. - Add corresponding unit tests (sync and async where applicable).