[Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, pylint-guidelines-checker 0.5.9#11197
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
There was a problem hiding this comment.
Pull request overview
This PR updates the @typespec/http-client-python package’s lint/type-check tooling targets (pylint, mypy, pyright, azure-pylint-guidelines-checker) and adjusts the Python generator output (docstrings + targeted pylint disables) to comply with new/stricter guideline checks.
Changes:
- Bump CI/dev and tox-installed tool versions (pylint, mypy, pyright, azure-pylint-guidelines-checker).
- Update generated templates to emit additional constructor/docstring documentation for models and serializer.
- Add targeted
pylintdisables in generator logic/config to silence known false-positives from updated guideline checks.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/http-client-python/tests/tox.ini | Bumps azure-pylint-guidelines-checker version used in tox lint env. |
| packages/http-client-python/generator/pygen/codegen/templates/serialization.py.jinja2 | Extends Serializer class docstring to document classes init parameter. |
| packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 | Injects keyword-argument doc lines into generated model class docstrings when a typed __init__ overload is produced. |
| packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 | Expands SdkJSONEncoder docstring to document constructor args/keywords. |
| packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py | Adds keyword-doc generation helper and a class-level pylint-disable helper to handle docstring guideline checks. |
| packages/http-client-python/generator/pygen/codegen/models/operation_group.py | Adds targeted docstring-missing-param suppression for non-mixin operation groups (which use *args/**kwargs). |
| packages/http-client-python/generator/pygen/codegen/models/client.py | Adds detection + suppression for docstring-only “keyword” params that are routed via **kwargs. |
| packages/http-client-python/eng/scripts/ci/dev_requirements.txt | Bumps pinned tool versions for CI/dev environment. |
| packages/http-client-python/eng/scripts/ci/config/pylintrc | Disables no-cross-package-private-import with an explanatory comment (guideline-checker false positive). |
| .chronus/changes/vnext-bump-2026-6-7-22-13-32.md | Adds Chronus entry for dependency/tool bumps. |
| .chronus/changes/python-docstring-guideline-checks-2026-7-14-11-30-0.md | Adds Chronus entry for generator behavior fix related to updated docstring checks. |
… 1.1.411, pylint-guidelines-checker 0.5.9 (Azure#4909) microsoft/typespec#11197
…t#11289) Follow-up fix to microsoft#11197 (pylint-guidelines-checker `0.5.9` bump). On regeneration, DPG models emitted a **duplicate docstring**: `:keyword:`/`:paramtype:` lines in the class docstring duplicated the existing `:ivar:`/`:vartype:` entries (e.g. `InvalidAuth`). ## Changes - Remove the redundant keyword-doc generation for DPG models (the source of the duplicated lines). - For DPG models, suppress `docstring-keyword-should-match-keyword-only` at the class line instead — DPG `__init__` overloads have empty bodies, so the checker validates keyword-only args against the *class* docstring, and we intentionally document those args once as `:ivar:` entries. ## Validation - locally ran `npm run regenerate` and full regeneration (azure + unbranded) succeeds; docstrings no longer duplicated. ## todo - [ ] disable `no-cross-package-private-import` in pylintrc of `typespec-azure` --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
bumping check versions Azure/azure-sdk-for-python#47920
also bump pylint guideline checker version from 0.5.2 to the latest 0.5.9
updates emitter for new rules
no-cross-package-private-importbecause it has false positivesdocstring-keyword-should-match-keyword-onlyfor now, because we have some params likeapi_versionthat are in the docstring but not explicit parameters and only in kwargsdocstring-missing-paramcheck which flags undocumented args in signatures likeinit(self, *args, **kwargs)