Skip to content

Commit 0370b02

Browse files
JennyPngCopilot
andauthored
Update docs and instructions to use azpysdk instead of tox (#45480)
* initial batch of tox removals * clean skills and remove unused yml * delete unused ymls * remove tox from next-* skill * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update contributing --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 97df7c1 commit 0370b02

13 files changed

Lines changed: 77 additions & 293 deletions

File tree

.github/copilot-instructions.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828

2929
**REFERENCE DOCUMENTATION:**
3030
- [Official pylint guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md)
31-
- [Tox formatting guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
31+
- [Tool usage guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/tool_usage_guide.md)
3232

3333
**COMMAND:**
3434
```bash
35-
tox -e pylint --c <path_to_tox.ini> --root .
35+
azpysdk pylint .
3636
```
3737

38-
**DEFAULT PATH:** `azure-sdk-for-python/eng/tox/tox.ini`
39-
4038
### FIXING PYLINT WARNINGS
4139

4240
**REFERENCE SOURCES:**
@@ -64,13 +62,13 @@ tox -e pylint --c <path_to_tox.ini> --root .
6462
### RUNNING AND FIXING MYPY
6563

6664
**REFERENCE DOCUMENTATION:**
67-
- [Tox guidance](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
65+
- [Tool usage guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/tool_usage_guide.md)
6866
- [MyPy fixing guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/static_type_checking_cheat_sheet.md)
6967

7068
**REQUIREMENTS:**
7169
- Use Python 3.9 compatible environment
7270
- Follow official fixing guidelines
73-
- Use tox mcp tool for running MyPy
71+
- Run `azpysdk mypy .` from the package directory
7472

7573
---
7674

.github/skills/eng/next-version-update/SKILL.md

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The repository pins specific versions of pylint, mypy, and pyright and runs week
1616
> **Required cross-repo check (do not skip):** After updating `azure-sdk-for-python`, you must also check whether matching updates are required in **both** [azure-sdk-tools](https://github.com/Azure/azure-sdk-tools) and [Microsoft/TypeSpec](https://github.com/microsoft/typespec). Treat the version bump as complete only after those repositories are reviewed and, when needed, PRs are opened.
1717
1818
Files updated in **azure-sdk-for-python**:
19-
- `eng/tox/tox.ini` – pinned versions for `[testenv:pylint]`, `[testenv:mypy]`, `[testenv:pyright]`
2019
- `eng/tools/azure-sdk-tools/azpysdk/pylint.py``PYLINT_VERSION` constant
2120
- `eng/tools/azure-sdk-tools/azpysdk/mypy.py``MYPY_VERSION` constant
2221
- `eng/tools/azure-sdk-tools/azpysdk/pyright.py``PYRIGHT_VERSION` constant
@@ -55,9 +54,9 @@ Before promoting, confirm the next-* weekly analyze jobs have passed for the `ht
5554

5655
Check the Azure DevOps pipeline named **"python - corehttp - tests-weekly"** or similar weekly analyze pipelines. All three of the following jobs must pass (or only have pre-existing failures that are tracked):
5756

58-
- **Run Pylint Next** (uses `next-pylint` tox env)
59-
- **Run MyPy Next** (uses `next-mypy` tox env)
60-
- **Run Pyright Next** (uses `next-pyright` tox env)
57+
- **Run Pylint Next** (uses `azpysdk next-pylint`)
58+
- **Run MyPy Next** (uses `azpysdk next-mypy`)
59+
- **Run Pyright Next** (uses `azpysdk next-pyright`)
6160

6261
Also verify via GitHub issues: the vnext issue creator creates/closes issues per-package. Check that there are no open `next-pylint`, `next-mypy`, or `next-pyright` issues for the core packages.
6362

@@ -66,7 +65,7 @@ Also verify via GitHub issues: the vnext issue creator creates/closes issues per
6665
Read the current next-* versions from `doc/analyze_check_versions.md`:
6766

6867
```bash
69-
grep -E "pylint_version|mypy_version|pyright_version" eng/tox/tox.ini
68+
grep -E "VERSION" eng/tools/azure-sdk-tools/azpysdk/pylint.py eng/tools/azure-sdk-tools/azpysdk/mypy.py eng/tools/azure-sdk-tools/azpysdk/pyright.py
7069
```
7170

7271
Note the **Next Version** values for pylint, mypy, and pyright. These are the versions being promoted to current.
@@ -109,43 +108,7 @@ git checkout -b bump-next-versions-{YYYYMMDD}
109108

110109
Replace `{YYYYMMDD}` with today's date (e.g., `bump-next-versions-20260420`).
111110

112-
### 6. Update `eng/tox/tox.ini`
113-
114-
**Promote next versions to current** (update the `[testenv:pylint]`, `[testenv:mypy]`, `[testenv:pyright]` sections):
115-
116-
In the `[testenv:pylint]` section:
117-
```
118-
pylint_version={OLD_NEXT_PYLINT_VERSION}
119-
```
120-
121-
In the `[testenv:mypy]` section:
122-
```
123-
mypy_version={OLD_NEXT_MYPY_VERSION}
124-
```
125-
126-
In the `[testenv:pyright]` section:
127-
```
128-
pyright_version={OLD_NEXT_PYRIGHT_VERSION}
129-
```
130-
131-
**Set new next-* versions** (update the `[testenv:next-pylint]`, `[testenv:next-mypy]`, `[testenv:next-pyright]` sections):
132-
133-
In the `[testenv:next-pylint]` section:
134-
```
135-
pylint_version={NEW_NEXT_PYLINT_VERSION}
136-
```
137-
138-
In the `[testenv:next-mypy]` section:
139-
```
140-
mypy_version={NEW_NEXT_MYPY_VERSION}
141-
```
142-
143-
In the `[testenv:next-pyright]` section:
144-
```
145-
pyright_version={NEW_NEXT_PYRIGHT_VERSION}
146-
```
147-
148-
### 7. Update `azpysdk` Python Constants
111+
### 6. Update `azpysdk` Python Constants
149112

150113
Update the version constants used by the azpysdk CLI:
151114

@@ -164,7 +127,7 @@ In `eng/tools/azure-sdk-tools/azpysdk/pyright.py`:
164127
PYRIGHT_VERSION = "{OLD_NEXT_PYRIGHT_VERSION}"
165128
```
166129

167-
### 8. Update `pylintrc` Files
130+
### 7. Update `pylintrc` Files
168131

169132
When pylint's **version** changes, the root `pylintrc` and `eng/pylintrc` may need to be updated to disable new warnings or enable newly-available rules.
170133

@@ -182,10 +145,10 @@ When pylint's **version** changes, the root `pylintrc` and `eng/pylintrc` may ne
182145
**For a minor/patch version bump:** Typically no pylintrc changes are needed, but verify by running:
183146
```bash
184147
cd sdk/core/corehttp
185-
tox -e next-pylint
148+
azpysdk next-pylint .
186149
```
187150

188-
### 9. Update `doc/analyze_check_versions.md`
151+
### 8. Update `doc/analyze_check_versions.md`
189152

190153
Update the version table to reflect the new pinned versions and next targets:
191154

@@ -201,7 +164,7 @@ The `{TARGET_DATE}` should be approximately 12 weeks from today (the date when t
201164

202165
If there is no newer version available yet, use `N/A` for both **Next Version** and **Next Version Merge Date**.
203166

204-
### 10. Update `eng/apiview_reqs.txt`
167+
### 9. Update `eng/apiview_reqs.txt`
205168

206169
Update the pylint version used by the apiview stub generator:
207170

@@ -212,13 +175,13 @@ pylint=={OLD_NEXT_PYLINT_VERSION}
212175
> **Note:** The `astroid` and related packages may also need version updates to be compatible with the new pylint version. Run the apistub check locally to verify:
213176
> ```bash
214177
> cd sdk/core/azure-core
215-
> tox -e apistub
178+
> azpysdk apistub .
216179
> ```
217180
218-
### 11. Commit Changes in azure-sdk-for-python
181+
### 10. Commit Changes in azure-sdk-for-python
219182
220183
```bash
221-
git add pylintrc eng/pylintrc eng/tox/tox.ini \
184+
git add pylintrc eng/pylintrc \
222185
eng/tools/azure-sdk-tools/azpysdk/pylint.py \
223186
eng/tools/azure-sdk-tools/azpysdk/mypy.py \
224187
eng/tools/azure-sdk-tools/azpysdk/pyright.py \
@@ -227,7 +190,7 @@ git add pylintrc eng/pylintrc eng/tox/tox.ini \
227190
git commit -m "Promote next-* tool versions: pylint {OLD_NEXT_PYLINT_VERSION}, mypy {OLD_NEXT_MYPY_VERSION}, pyright {OLD_NEXT_PYRIGHT_VERSION}"
228191
```
229192
230-
### 12. Create Pull Request in azure-sdk-for-python
193+
### 11. Create Pull Request in azure-sdk-for-python
231194

232195
Push branch and create PR:
233196

@@ -250,7 +213,7 @@ gh pr create \
250213
- [ ] Checked **Microsoft/TypeSpec** for matching tool-version updates; opened PR if needed"
251214
```
252215

253-
### 13. Update azure-sdk-tools Repository (Separate PR)
216+
### 12. Update azure-sdk-tools Repository (Separate PR)
254217

255218
> **Required review:** Always review this repo for every run of this skill. A PR is required whenever the version bump affects apiview parser dependencies/config.
256219
@@ -285,7 +248,7 @@ For a pylint **version** bump, create a separate PR in the [azure-sdk-tools](htt
285248
--body "Updates the pylint version used by the apiview stub generator from {OLD_PYLINT_VERSION} to {OLD_NEXT_PYLINT_VERSION}."
286249
```
287250

288-
### 14. Update Microsoft/TypeSpec Repository (Separate PR)
251+
### 13. Update Microsoft/TypeSpec Repository (Separate PR)
289252

290253
> **Required review:** Always review this repo for every run of this skill. A PR is required whenever TypeSpec pins or tooling references the bumped versions.
291254

.github/skills/ml/fix-mypy/SKILL.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,18 @@ Intelligently fixes mypy issues by:
2525

2626
## Running MyPy
2727

28-
**Command for entire package:**
28+
**Command:**
2929
```powershell
3030
cd sdk/ml/azure-ai-ml
31-
tox -e mypy --c ../../../eng/tox/tox.ini --root .
31+
azpysdk mypy .
3232
```
3333

34-
**Command for specific file/module:**
35-
```powershell
36-
cd sdk/ml/azure-ai-ml
37-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- path/to/file.py
38-
```
34+
> **Note:** `azpysdk` runs at the package level only. To focus on specific files, run the full check and filter the output by file path.
3935
4036
## Reference Documentation
4137

4238
- [Azure SDK Python MyPy Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/static_type_checking_cheat_sheet.md)
43-
- [Tox Guidance](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
39+
- [Tool Usage Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/tool_usage_guide.md)
4440
- [Official MyPy Documentation](https://mypy.readthedocs.io/en/stable/)
4541
- [MyPy Common Issues](https://mypy.readthedocs.io/en/stable/common_issues.html)
4642

@@ -95,23 +91,17 @@ pip install -e .
9591

9692
Based on the GitHub issue details, determine which files to check:
9793

98-
**Option A - Issue specifies files:**
94+
**Option A - Run mypy on the package and filter output:**
9995
```powershell
10096
# Ensure you're in azure-ai-ml directory (within activated venv)
10197
cd sdk/ml/azure-ai-ml
10298
103-
# Run mypy on specific files mentioned in the issue (within activated venv)
104-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- path/to/specific_file.py
105-
```
106-
107-
**Option B - Issue mentions module/directory:**
108-
```powershell
109-
# Run mypy on specific module (within activated venv)
110-
cd sdk/ml/azure-ai-ml
111-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- azure/ai/ml/specific_module/
99+
# Run mypy on the full package, then filter output for files from the issue
100+
azpysdk mypy .
101+
# Review output for errors in the specific files/modules mentioned in the issue
112102
```
113103

114-
**Option C - Check modified files (if no specific target):**
104+
**Option B - Check modified files (if no specific target):**
115105
```powershell
116106
git diff --name-only HEAD | Select-String "sdk/ml/azure-ai-ml"
117107
git diff --cached --name-only | Select-String "sdk/ml/azure-ai-ml"
@@ -125,8 +115,9 @@ git diff --cached --name-only | Select-String "sdk/ml/azure-ai-ml"
125115
# Navigate to azure-ai-ml directory
126116
cd sdk/ml/azure-ai-ml
127117
128-
# Run mypy targeting the specific area from the issue (within activated venv)
129-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- <target-from-issue>
118+
# Run mypy on the package (within activated venv)
119+
azpysdk mypy .
120+
# Filter output for the specific files/modules from the issue
130121
```
131122

132123
### Step 5: Analyze Type Errors
@@ -287,8 +278,9 @@ pip install -e .
287278
# 2. Identify target from issue
288279
$targetFile = "azure/ai/ml/operations/job_operations.py"
289280
290-
# 3. Run mypy on specific file
291-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- $targetFile
281+
# 3. Run mypy on the package and check output for target file
282+
azpysdk mypy .
283+
# Filter output for errors in $targetFile
292284
293285
# 4. Analyze output and identify fixable issues
294286
# Cross-reference with GitHub issue #12345
@@ -299,7 +291,7 @@ grep -r "from typing import" azure/ai/ml/ | findstr "operations"
299291
# 6. Apply fixes to identified files
300292
301293
# 7. Re-run mypy to verify
302-
tox -e mypy --c ../../../eng/tox/tox.ini --root . -- $targetFile
294+
azpysdk mypy .
303295
304296
# 8. Report results
305297
```

.github/skills/ml/fix-pylint/SKILL.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,20 @@ Intelligently fixes pylint issues by:
2525

2626
## Running Pylint
2727

28-
**Command for entire package (tox):**
28+
**Command:**
2929
```powershell
3030
cd sdk/ml/azure-ai-ml
31-
tox -e pylint --c ../../../eng/tox/tox.ini --root .
31+
azpysdk pylint .
3232
```
3333

34-
**Command for specific file/module:**
35-
```powershell
36-
cd sdk/ml/azure-ai-ml
37-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- path/to/file.py
38-
```
34+
> **Note:** `azpysdk` runs at the package level only. To focus on specific files, run the full check and filter the output by file path.
3935
4036
## Reference Documentation
4137

4238
- [Azure SDK Python Pylint Guidelines](https://github.com/Azure/azure-sdk-tools/blob/main/tools/pylint-extensions/azure-pylint-guidelines-checker/README.md)
4339
- [Official Pylint Documentation](https://pylint.readthedocs.io/en/stable/user_guide/checkers/features.html)
4440
- [Azure SDK Python Pylint Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md)
45-
- [Tox Formatting Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
41+
- [Tool Usage Guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/tool_usage_guide.md)
4642

4743
## Fixing Strategy
4844

@@ -93,23 +89,17 @@ pip install -e .
9389

9490
Based on the GitHub issue details, determine which files to check:
9591

96-
**Option A - Issue specifies files:**
92+
**Option A - Run pylint on the package and filter output:**
9793
```powershell
9894
# Ensure you're in azure-ai-ml directory (within activated venv)
9995
cd sdk/ml/azure-ai-ml
10096
101-
# Run pylint on specific files mentioned in the issue (within activated venv)
102-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- path/to/specific_file.py
103-
```
104-
105-
**Option B - Issue mentions module/directory:**
106-
```powershell
107-
# Run pylint on specific module (within activated venv)
108-
cd sdk/ml/azure-ai-ml
109-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- azure/ai/ml/specific_module/
97+
# Run pylint on the full package, then filter output for files from the issue
98+
azpysdk pylint .
99+
# Review output for warnings in the specific files/modules mentioned in the issue
110100
```
111101

112-
**Option C - Check modified files (if no specific target):**
102+
**Option B - Check modified files (if no specific target):**
113103
```powershell
114104
git diff --name-only HEAD | Select-String "sdk/ml/azure-ai-ml"
115105
git diff --cached --name-only | Select-String "sdk/ml/azure-ai-ml"
@@ -123,8 +113,9 @@ git diff --cached --name-only | Select-String "sdk/ml/azure-ai-ml"
123113
# Navigate to azure-ai-ml directory
124114
cd sdk/ml/azure-ai-ml
125115
126-
# Run pylint targeting the specific area from the issue (within activated venv)
127-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- <target-from-issue>
116+
# Run pylint on the package (within activated venv)
117+
azpysdk pylint .
118+
# Filter output for the specific files/modules from the issue
128119
```
129120

130121
### Step 5: Analyze Warnings
@@ -237,8 +228,9 @@ pip install -e .
237228
# 2. Identify target from issue
238229
$targetFile = "azure/ai/ml/operations/job_operations.py"
239230
240-
# 3. Run pylint on specific file
241-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- $targetFile
231+
# 3. Run pylint on the package and check output for target file
232+
azpysdk pylint .
233+
# Filter output for warnings in $targetFile
242234
243235
# 4. Analyze output and identify fixable issues
244236
# Cross-reference with GitHub issue #12345
@@ -249,7 +241,7 @@ Get-ChildItem -Recurse azure/ai/ml/ | Select-String "similar_pattern"
249241
# 6. Apply fixes to identified files
250242
251243
# 7. Re-run pylint to verify
252-
tox -e pylint --c ../../../eng/tox/tox.ini --root . -- $targetFile
244+
azpysdk pylint .
253245
254246
# 8. Report results
255247
```

0 commit comments

Comments
 (0)