Skip to content

[Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, pylint-guidelines-checker 0.5.9#11197

Merged
JennyPng merged 6 commits into
microsoft:mainfrom
JennyPng:vnext-bump
Jul 16, 2026
Merged

[Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, pylint-guidelines-checker 0.5.9#11197
JennyPng merged 6 commits into
microsoft:mainfrom
JennyPng:vnext-bump

Conversation

@JennyPng

@JennyPng JennyPng commented Jul 7, 2026

Copy link
Copy Markdown
Member

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

  • disable no-cross-package-private-import because it has false positives
  • suppress docstring-keyword-should-match-keyword-only for now, because we have some params like api_version that are in the docstring but not explicit parameters and only in kwargs
  • build keyword param lines for docstring
  • suppress docstring-missing-param check which flags undocumented args in signatures like init(self, *args, **kwargs)

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jul 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11197

commit: ecb0aa5

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

[Python] Generate model/client/config docstrings and targeted pylint suppressions that satisfy the updated azure-pylint-guidelines-checker docstring checks (docstring-keyword-should-match-keyword-only, docstring-missing-param)

@typespec/http-client-python - dependencies ✏️

[Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, azure-pylint-guidelines-checker 0.5.9

@azure-sdk-automation

azure-sdk-automation Bot commented Jul 7, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@JennyPng JennyPng changed the title [Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411 [Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, pylint-guidelines-checker 0.5.9 Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pylint disables 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.

@JennyPng
JennyPng added this pull request to the merge queue Jul 16, 2026
Merged via the queue into microsoft:main with commit 135189f Jul 16, 2026
40 of 41 checks passed
@JennyPng
JennyPng deleted the vnext-bump branch July 16, 2026 20:58
kazrael2119 pushed a commit to kazrael2119/typespec-azure that referenced this pull request Jul 17, 2026
chidozieononiwu pushed a commit to chidozieononiwu/typespec that referenced this pull request Jul 21, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants