Skip to content

Conversation

@Silv3S
Copy link
Contributor

@Silv3S Silv3S commented Oct 27, 2025

Since 2.9 release upstream set min Python version to 3.10 pytorch/pytorch#162310. We should align linters and scripts. Bumping linters also enables new lints, such as B905, which will not be fixed in this PR. This lint is xfailed in upstream too

Copy link
Contributor

Copilot AI left a comment

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 minimal supported Python version from 3.8 to 3.10 across the codebase, aligning with PyTorch 2.9's upstream requirement. The changes modernize Python type hints and syntax throughout linter tools, test files, and configuration files.

Key changes:

  • Replaced legacy typing module imports with built-in generic types (e.g., list[T] instead of List[T])
  • Added strict=False parameter to zip() calls for explicit iteration behavior
  • Updated configuration files to reflect Python 3.10+ target versions

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/linter/adapters/*.py Modernized type hints by replacing typing module generics with built-in types and moving abstract types to collections.abc
test/xpu/*.py Added strict=False to zip() calls and updated type annotations to use built-in generics
test/xpu/distributed/*.py Added strict=False parameter to zip() calls for explicit behavior
test/regressions/*.py Added strict=False to zip() calls in bilinear interpolation functions
test/microbench/*.py Added strict=False to zip() calls in benchmark loops
pyproject.toml Updated Black and Ruff target versions from py38 to py310
mypy-strict.ini Changed mypy python_version from 3.8 to 3.10
.lintrunner.toml Removed python_version constraints that referenced 3.9
.github/scripts/*.py Modernized type hints to use built-in generics and union syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants